Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

split string c# with delimiter

char[] delimiterChars = { ' ', ',', '.', ':', '	' };

string text = "one	two three:four,five six seven";
System.Console.WriteLine($"Original text: '{text}'");

string[] words = text.Split(delimiterChars);
System.Console.WriteLine($"{words.Length} words in text:");

foreach (var word in words)
{
    System.Console.WriteLine($"<{word}>");
}
Source by learn.microsoft.com #
 
PREVIOUS NEXT
Tagged: #split #string #delimiter
ADD COMMENT
Topic
Name
1+2 =