Shadab Khan5,255 Points
Please explain me the concept of - StringSplitOptions.None - when splitting a string
Hi, If somebody understands this better, can they please explain me the exact use of the StringSplitOptions.None enum when splitting a string. An example for explanation will be great. Thanks very much in advance.
Steven Parker186,664 Points
The option "
StringSplitOptions.None" is the default, which means that if two of your specified delimiter are next to each other, you'll get an element in the array that contains an empty string. The alternative choice is "
StringSplitOptions.RemoveEmptyEntries", which means that a delimiter next to another will be disregarded, and you'll only get array elements that have non-empty contents.
There's more details and several code examples on this MDN page: StringSplitOptions Enumeration.