In C# is there a way to split by line-break or any other character for that matter?
I need to take string:
1,2,9,10,39,14
and split by the ","
Splitting...
Started by Chan, Jun 27 2007 06:13 AM
3 replies to this topic
#1
Posted 27 June 2007 - 06:13 AM
|
|
|
#2
Posted 27 June 2007 - 06:20 AM
If you have a string like this:
string myString = "1,2,9,10,39,14";And want each one of them (1, 2, 9, 10, 39, 14) to become strings in an array, you can do something like this:
string[] myArray = myString.Split(',');
In this example the ',' is of course our delimeter.
#3
Posted 05 August 2007 - 12:08 PM
What if you want to split by a string? Because i have this problem: i want to split a string by the string "//DATA//", but i Hate RegEx. is there any other way?
#4
Guest_Jordan_*
Posted 06 August 2007 - 04:41 AM
Guest_Jordan_*
Regex would be your best choice and you don't need a full-blown regex expression to split by string:
string[] myArray = Regex.Split(myString,"//DATA//");


Sign In
Create Account


Back to top









