Getting rid of spaces


#1

Dear all,

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

Thanks!


#2

@avene

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

#4

@avene

This one is easier.

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

It returns Thisisforumuipath.


#5

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


#6

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