C# Language Splitting a string using a delimiter


Example

Use the System.String.Split method to return a string array that contains substrings of the original string, split based on a specified delimiter:

string sentence = "One Two Three Four";
string[] stringArray = sentence.Split(' ');

foreach (string word in stringArray)
{
    Console.WriteLine(word);    
}

Output:

One
Two
Three
Four