How to split string by string in Powershell
The -split operator uses the string to split, instead of a chararray like Split(): If you want to use the Split() method with a string, you need the $seperator to be a stringarray with one element, and also specify a stringsplitoptions value. You can see this by checking its definition: EDIT: As @RomanKuzmin pointed out, -split splits using regex-patterns by default. So be aware … Read more