Answers for "separate string by comma c#"

1

c# separate string by comma

string[] words = phrase.Split(' ');
Posted by: Guest on January-31-2021
5

how to split a string with strings in c#

string[] separatingStrings = { "<<", "..." };

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

string[] words = text.Split(separatingStrings, System.StringSplitOptions.RemoveEmptyEntries);
System.Console.WriteLine($"{words.Length} substrings in text:");

foreach (var word in words)
{
    System.Console.WriteLine(word);
}
Posted by: Guest on April-13-2020
-1

convert comma separated string to array c#

string fruit = "Apple,Banana,Orange,Strawberry";
string[] split = fruit.Split(',');
Posted by: Guest on May-29-2020

Code answers related to "separate string by comma c#"

Code answers related to "Javascript"

Browse Popular Code Answers by Language