dchau12
asked on
String.split
How do I use the String.split method when the delimiter is a carrage return?
Or, how do I use String.split with a string delimeter instead of a character delimiter? So, in the case the delimiter would be "\r"
Or, how do I use String.split with a string delimeter instead of a character delimiter? So, in the case the delimiter would be "\r"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or you can use Environment.NewLine
ASKER
hey satjheeshm, str2 = str1.Split('\n'); does not work. The delimiter is looking for a character. A character is only one entry. '\n' is a string.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Continued....
The str2 string array has three elements after the split. The last element is and empty string.
Gary Davis
The str2 string array has three elements after the split. The last element is and empty string.
Gary Davis
ASKER
I was dead wrong. Good follow up gardavis.