I have a variable which gets text.
The text will be: “Your transaction number 123456789 has been submitted”
How can I make the output display only the numbers?
Output: 123456789
I have a variable which gets text.
The text will be: “Your transaction number 123456789 has been submitted”
How can I make the output display only the numbers?
Output: 123456789
@dvn Try using this Expression in a Message Box :
System.Text.RegularExpressions.Regex.Matches(“Your transaction number 123456789 has been submitted”,“\d+”)(0)
Use this regex to solve
System.Text.RegularExpressions.Regex.Matches(inputstring,“([0-9]+)”)
Try the regex with Replace all the text except numbers .
Hi @dvn,
If you want to keep all the digits present in a string and remove all the other characters then, please try with the below -
System.Text.RegularExpressions.Regex.Match(YourString, “[0-9]+”).ToString.Trim
Thanks & Regards,
Apurba
@dvn, Got solution ah? if you got Solution means close/Mark the solution - corresponding replied for you
Thanks and Regards,
Vivek