Split string on tab character

i have a string that looks like this:
287/2019\t25,89\t21,05\tMatt
i would like to split it on tab character, so i can access 25,89.

@lolek81,

try below one:

str = “287/2019\t25,89\t21,05\tMatt”

reqStr = str.split(“\t”.ToCharArray)(1)

No luck, i get empty string.

Split(string,“\t”) the output of this is arritems, use for each and print all the items and see which index has 25,89.

I think first index has some space.

@lolek81,

Try below one. It will work.

reqStr = str.split(“\t”.ToCharArray)(2)

1 Like

Hi lakshman:

Can you please help me out with the below string data
“25 2019 123 456 #”
I would like to split the data, so i can access 123.

REgards,
Suds

@Suds24

Try this.

Str = “25 2019 123 456 #”

reqStr = Str.split(" ".ToCharArray)(2)

1 Like

@lakshman,

Thanks for your quick response. Its not a space in each value, but its a tab space in each value. Can you please enter the tab space in each value and find out the value of 123.

Screenshot for your reference.

image

Thanks,
Suds

@Suds24

Try this:

Str.Split(vbTab.ToCharArray)(2)

1 Like

@lakshman

It works. Thanks for your help…

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.