How to split string using with string delimiter in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string s = "C# is a general-purpose is multi-paradigm is programming language";
        
        string[] arr = s.Split(new[] { "is" }, StringSplitOptions.None);
        
        foreach (string val in arr) {
            Console.WriteLine(val);
        }
    }
}




/*
run:

C# 
 a general-purpose 
 multi-paradigm 
 programming language
 
*/

 



answered Jun 25, 2021 by avibootz

Related questions

1 answer 115 views
2 answers 183 views
1 answer 222 views
1 answer 73 views
2 answers 281 views
...