Remove whitespace

Hello i am extracting a string that looks like this “1 311,0” How can i remove the white space between 1 and 3 ?

I have tried the following solutions.
Replace method
Regex.Replace
String…Replace(" “,”")

1 Like

string.Replace(" ", [String].Empty)
try this!
@langsem

getting “Referance to a member thats not shared, needs a objectrefereance”

1 Like

where you are getting that string from?
@langsem
“1 311,0”.Replace(" ", [String].Empty)

@langsem, String.Replace(" ", “”) should work. If its not then its not a space but it must be some special character. Usually it happens if string/value is copy pasted.

i just made a placeholder string to test it out, but originally i get the string from a desktop app

1 Like

try this “1 311,0”.Replace(" ", [String].Empty) use this in message box @langsem

image
it’s working fine for me!

think maybe the syntax that i am getting from the app its different
Will this look for all whitespaces ?

1 Like

yes! @langsem

Ok, going to try. Thanks for the help :slight_smile:

@langsem
If string.Replace is not working for you, use regex replace function by specifying the pattern “+” and Replacement as String.Empty in the properties.
This always make sure that all the space will be replaced.

If you think the data from your app is returning some other characters instead of space, copy paste only that character in the pattern along with space.
For example, if your app returns ‘a’ in place of space as 1a311,0 => your pattern = [a-z ]+

2 Likes

Thanks wil try this if its not working :slight_smile:

2 Likes

this did not work :confused:

still “1 313,00”

1 Like

can i see screen shot what you are trying to do?
@langsem

1 Like

check your GetText output syntax looks fine @langsem

image
it’s working fine for me!
@langsem

what you mean, what i get as output ?

1 Like

yup! @langsem