How to replace something at a particular index of the string in UiPath

I have a string

Screenshot (30)

As you can see there is a bunch of white space after the word quantity how can I remove those extra whitespaces and make my sentence as :

The notified quantity exceeds the ordered quantity 550 KG

Read articles, tried many things but none worked.

Hi @Ishan_Shelke1 ,

Could you try the below Expression :

OutputString = System.Text.RegularExpressions.Regex.Replace(yourInputString,"\s+"," ")
1 Like

Hi @Ishan_Shelke1 ,

Could you give this a try?

System.Text.RegularExpressions.Regex.Replace(yourInputString,"\s{2,}"," ")

Kind Regards,
Ashwin A.K

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