C# Program to Split a string having characters like ;/?.,- in between using Split function of System.String class

Rajnilari2015
Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 151
using System;
using System.Linq;

namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
"niladri,arina/biswas?babai;RNA.Team-We All Are Same -Is not it?Yes it is"
.Split(new Char[] { ';','/','?','.',',','-' }, StringSplitOptions.RemoveEmptyEntries)
.ToList()
.ForEach(i => Console.WriteLine(i));

Console.ReadKey();

}
}
}


Result
-------

niladri
arina
biswas
babai
RNA
Team
We All Are Same
Is not it
Yes it is

Comments or Responses

Login to post response