Getting rid of spaces

Dear all,

I have a string with differing number of spaces for different rows. How do i get rid of the spaces?

Thanks!

@avene

                                      a="This            is            forum       uipath"
     
                                     assign a = Regex.Replace( a," {2,}", " ")
2 Likes

@avene

This one is easier.

`("This            is            forum       uipath").Replace(" ","")`

It returns Thisisforumuipath.

1 Like

Or use,
string = string.replace(/\s\s+/g, ’ ')

1 Like

Regex.Replace(YourStringvariable, " ", string.Empty) @avene

1 Like