11-11
April 3, 2020, 5:51pm
1
Hello2All
I would like to remove all spaces (blank / white space) from numbers
@ server side
just bevor or within the DB insert command
e.g.
bevor ‘6 700’
after ‘6700’ (all spaces gone)
Is there a wappler way to replace or delete all whitespaces in a number?
Thank you very much for your help
John
TomD
April 3, 2020, 6:13pm
2
You could use the replace formatter like this:
{{$_POST.text_with_spaces.replace(' ', '')}}
I’m not sure if this is quite possible using the UI - it seems to wrap the quotes in extra quotes when trying to replace with nothing. (The quotes in this example are all single.)
1 Like
11-11
April 3, 2020, 6:46pm
3
Great, TomD
Your Idea is allmost complete.
I had to change your fine solution a bit. Into…
{{$_POST.text_with_spaces.replace(’ ‘,’’)}}
(removing the space after the comma
I am very thankful for ur help.
Best regard, John
TomD
April 3, 2020, 6:52pm
4
I’m glad that helped. I don’t think I particularly intended to include the space - but I don’t know why it would make a difference.
swf
November 6, 2020, 8:05am
5
Just had to implement this again in a project.
The best way to remove spaces is by using .camelize() in the UI.
2 Likes
cpuser
June 10, 2022, 8:57pm
6
I just used the same thing in a project. It removes spaces from any string, numbers etc.
Here is the Camelize in case someone wants to use it.