String split manipulation question

I have a string value 19/10/1995
I need to split separately V1 =19
After that V2= 10
After that V2 = 1995

Can anyone help me on this

arrSplits = “19/10/1995”.Split("/"c)
then
v1 = arrSplits(0)
v2 = arrSplits(1)
v3 = arrSplits(2)

grafik
YourStringVar.Trim.Split("/"c)

1 Like

Hi @Arya_Squares ,

The Delimiter is /.

Hence the following should be able to get your data as expected .

DayVar = Split("19/10/1995","/")(0)

MonthVar = Split("19/10/1995","/")(1)

YearVar =  Split("19/10/1995","/")(2)

Here, DayVar, MonthVar and YearVar are string type variables.

Hi @Arya_Squares

You can try with regex expression

YourString = “19/10/1995”

System.Text.RegularExpressions.Regex.Matches(YourString,"\d+")(0)
System.Text.RegularExpressions.Regex.Matches(YourString,"\d+")(1)
System.Text.RegularExpressions.Regex.Matches(YourString,"\d+")(2)

image

Regards
Gokul