Splitting a String by another string C# with Example



Splitting a String by another string C# with Example

string str = "this--is--a--complete--sentence"; 
string[] tokens = str.Split(new[] { "--" }, StringSplitOptions.None); 
Result: 
[ "this", "is", "a", "complete", "sentence" ] 

0 Comment's

Comment Form

Submit Comment