I have a string "mystring theEnd" but I want to do a string.Split on white space, not just on a space because I want to get a string[] that contains “mystring” and “theEnd” between “mystring” and “theEnd” there is an unknown amount of spaces, this is why I need to split on whitespace. Is there a way to do this?
I have a string mystring theEnd but I want to do a string.Split on
Share
How about:
(Or
text.Splitspecifying the exact whitespace characters you want to split on, or usingnullas Henk suggested.)Or you could use a regex to handle all whitespace characters: