Need to split number into digit as a list

Hi Guys,
I have a string 556688 which is extracted from website, i need to split the number and add into the list where it should not contain repeated digit .
Eg= in a list i need only 568
or
if number is 2225599
list should have only 259

Thanks in Advance

Hi,

Can you try the following expression?

listSrtring = yourString.Select(Function(c) c.ToString).Distinct.ToList

Regards,

2 Likes

Thank you this works.
As i am new to the the uipath iam still learning VB Thanks once again.

1 Like

@Yoichi
Sorry to bother again
I have a string 1.51.544 from which i need to get 1.5 and 4 is it possible.

Hi,

How about the following expression?

listSrtring=System.Text.RegularExpressions.Regex.Matches(yourString,"\d\.\d|((?<!\.)|(?<=^))\d((?!\.)|(?=$))").Cast(Of System.Text.RegularExpressions.Match).Select(Function(m) m.Value).Distinct.ToList
1 Like

Did you ever geht that String? Same Position of Dots, Same length of number Parts?

thanks bro it worked.

Hi,

Sorry, i had a little mistake. can you use the following?

listSrtring = System.Text.RegularExpressions.Regex.Matches(yourString,"\d\.\d|((?<!\.)|(?<=^))\d((?!\.)|(?=$))").Cast(Of System.Text.RegularExpressions.Match).Select(Function(m) m.Value).Distinct.ToList

Regards,

the strings i may get are like

1)222.52.5 out of which i need 2&2.5
2)112255 out of which i need 1,2&5
3)1.51.52.52.5 out of which i need 1.5&2.5

I think both of them are same right?

Hi,

Sorry for confusion.
There is a little miss in my first post of #5, and I modified it.
In case of you already got the wrong expression, I posted #8 . Now both are same.

Regards,

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