VB.net Program to Split a string having characters like ;/?.,- in between using Replace and split

Rajnilari2015
Posted by Rajnilari2015 under VB.NET category on | Points: 40 | Views : 163
Imports System.Linq
Imports System.Text.RegularExpressions

Namespace ConsoleApplication
Class Program
Private Shared Sub Main(args As String())
'replacing with tilde
'split with tilde
New Regex("[;/?.,-]").Replace("niladri,arina/biswas?babai;RNA.Team-We All Are Same -Is not it?Yes it is", "~").Split("~"C).ToList().ForEach(Function(i) Console.WriteLine(i))

Console.ReadKey()

End Sub
End Class
End Namespace


Result
-------

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

Comments or Responses

Login to post response