Splitting a String by specific character C# with Example



Splitting a String by specific character C# with Example

string helloWorld = "hello world, how is it going?"; 
string[] parts1 = helloWorld.Split(','); 
//parts1: ["hello world", " how is it going?"] 
string[] parts2 = helloWorld.Split(' '); 
//parts2: ["hello", "world,", "how", "is", "it", "going?"] 

0 Comment's

Comment Form

Submit Comment