Reputation: 635
I need to split string variable by multiple characters, in my case by " "
;
Here is my code:
string s_var = "New String variable";
string[] s_mas = s_var.Split(" ");
The Split() method isn't working for me, it says that the argument " "
is invalid.
Hoping you guys know how to solve this issue.
Upvotes: 0
Views: 96
Reputation: 66439
You're not specifying the correct arguments.
Try this:
var s_mas = s_var.Split(new[] { " " }, StringSplitOptions.None);
Upvotes: 4