Hi All,
I am getting some string variables as “ABC DEF GHI 95636705” or “ABC DEF GHI3469234”. A word that that contains only digits or last word contains string and digits as well.
Can anyone advise me how, to remove the digits only from the last word of the string like this?
1 Like
vr24
(Vinay)
September 17, 2019, 7:03am
2
Hi
You can try to remove the last char like string.trimEnd
vr24
(Vinay)
September 17, 2019, 7:05am
3
inp
(impal)
September 17, 2019, 7:10am
4
@satyajit.samanta Follow Below solution
Assign str = “ABC DEF GHI 95636705”
Assign str = System.Text.RegularExpressions.Regex.Replace(str ,"\d", " ")
Now str will have the result ABC DEF GHI
Hope this helps you.
5 Likes
rado
September 17, 2019, 7:18am
5
@inp
Assign str = System.Text.RegularExpressions.Regex.Replace(str ,“\d”, " ").Trim
I would add Trim to end of your statemnt just to remove unwanted spaces.
Vashisht
(Vashisht Devasani)
September 17, 2019, 7:20am
6
Hi @satyajit.samanta ,
Welcome back to Forum…
I prepared a workflow for your case, once see the file .I hope it helps you.
File:removeDigits.xaml (4.9 KB)
If you find it useful mark it as solution and close the thread.
If any queries ping me:grinning:
Thanks
Vashisht
1 Like