i want to replace 5 blank space to single space, 6 blank space to single space and 9 blank space to single space in the same string
can replace activity do it.
Hi @ashishmani,
Please try with Regex. Hope you have stored the string into a String Variable.
Now, try the below -
Regex.Replace(Your_String_Variable,β\s+β," ")
Hope it will help you.
Thanks & Regards,
Apurba
the best way for this is using regex. For you case try this:
system.Text.RegularExpressions.Regex.Replace(your_string,β\s{5}β," β) and
system.Text.RegularExpressions.Regex.Replace(your_string,β\s{6}β,β ")
\s represent any space character
How use it?
Put a assign activity β
your_string = system.Text.RegularExpressions.Regex.Replace(your_string,β\s{5}β," ")
Just remember that you should first do the 9 space, then the 6 space, then the 5 space replace in that order
hi @ ashishmani,
or use replace in norlam
Like
to 5
YourString = YourString.Reaplce(" β,β β) β 5 Times Space
to 6
YourString = YourString.Reaplce(β β,β β) β 6 Times Space
to
YourString = YourString.Reaplce(β β,β ") β 9 Times Space
this AND condition is not working here
there is no AND condition there, just do the replace 3 times one after the otherβ¦
my string type is "System.string[ .]
Please look at this: Main.xaml (5.0 KB)
In your screenshot seems like β¦ your code having extra " and . remove last two digit in your code &
system.Text.RegularExpressions.Regex.Replace(your_string,β\s{5,9}β," ")
more than one Space use below code
system.Text.RegularExpressions.Regex.Replace(your_string,β\s{2,}β," ")
Please provide your input string or xaml.
Use a for each thenβ¦
still getting error
use like you have in expression editor and lines.toString,"\sβ¦