How to get numbers before % in string using Reg Ex

For Ex : String = “15.2 % ad”

result = 15.2 (in double)

search for digit
[0-9]

1 Like

hi @Suastrian_Dika ,

Use the following the Matches activity: (.*)%, it should return you the data before %

Regards,
Aditya

1 Like

@Suastrian_Dika ,
Try this

OutputString = Split("15.2 % ad","%")(0).ToString.Trim

Output :
image

Regards,

1 Like


[0-9.]

1 Like

regex simple:
grafik

Anchored
grafik

Assign Activity:
myDouble = CDbl(System.Text.RegularExprressions.Regex.Match(strText, strPattern).Value.Trim)

1 Like

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