Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One issue is that the -split feature in Powershell uses regular expressions by default, which can be confusing for those who are not familiar with regex. Another issue is that it can lead to unexpected results if the separator character is also present within the string itself. For example, if trying to split a string containing "hello-world" with the separator "-" using -split, it will result in two separate strings "hello" and "world", but if the string is "hello-world-and-more-worlds", it will result in three separate strings "hello", "world", "and more worlds".