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

Rajnilari2015
Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 185


using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
Regex
.Split("niladri,arina/biswas?babai;RNA.Team-We All Are Same -Is not it?Yes it is", @"[;/?.,-]+")
.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