Answers for "split using string c#"

C#
6

c# split a string and return list

listStrLineElements = line.Split(',').ToList();
Posted by: Guest on February-25-2020
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

split using string c#

//Split using a string delimiter instead of a char
data.Split(new string[] { "xx" }, StringSplitOptions.None);
Posted by: Guest on April-18-2020

C# Answers by Framework

Browse Popular Code Answers by Language