Remove spaces in calculated strings | Community
Skip to main content
Level 2
December 7, 2019
Question

Remove spaces in calculated strings

  • December 7, 2019
  • 4 replies
  • 2103 views
The REPLACE() function seems to behave normally. Until you try to replace a " "(space) with a ""(no space). It doesn't like the no space thing. How do I remove all the spaces from a string? I can put in about any other character but not "no space". Byron Nash INSP, LLC.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

Doug_Den_Hoed_AtAppStore
Community Advisor
Community Advisor
December 7, 2019
Huh: confirmed, Byron. I've never noticed that. I'd suggest you report it as a bug, but suspect there might be a technical/security reason preventing it (although I can't think of one, myself). Regards, Doug Doug Den Hoed - AtAppStore
ByronNa1Author
Level 2
December 10, 2019
Thanks, I submitted a ticket. Byron Nash INSP, LLC.
ByronNa1Author
Level 2
December 12, 2019
It appears to be a limitation of the syntax according to support. Does anyone have any workarounds for this sort of thing? Byron Nash INSP, LLC.
Level 3
January 3, 2024

@byronna1 

Still appears to be happening. I can't think of a workaround. Did you find one??

Doug_Den_Hoed_AtAppStore
Community Advisor
Community Advisor
January 4, 2024

 

Hi @byronna1 and @robertdy,

 

Thanks for re-raising this challenge. I decided to solve it.

 

Unfortunately, the bug preventing the REPLACE function from substituting a " " with "" has not yet been fixed:

 

REPLACE({name}," ","")

 

However...

 

After a transcendental meander through my Save Until Needed Vault, I am pleased to share the following workaround, as shown below:

 

 

Here is the textmode for each column:

 

displayname=Replace Spaces With ~ textmode=true valueexpression=REPLACE({name},' ','~') valueformat=HTMLdisplayname=Replace Spaces with New Line textmode=true valueexpression=REPLACE({name}," ","\\u000A") valueformat=HTML

and last but not least, the One You're After:

displayname=Replace Spaces with Null Character textmode=true valueexpression=REPLACE({name}," ","\\u0000") valueformat=HTML

 

Note, though, that (as I mentioned in this related post)...because these formulas leverage Unicode control characters there is a GOTCHA: "...remember to always re-supply the extra leading \ symbols that are sacrificed whenever such calculations are edited via the front end (vs pushing such calcs in via the API)."

 

That aside: one more down, zillions to go.

 

Have fun.

 

Regards,

Doug

December 13, 2024

Hi ByronNa, for my side I had a similar situation, I was getting the information: "bulldog english" and It should be "bulldog/english" so I needed to replace the white space with '/' My first step was to sent all the string to encondeURL, the white space will be %20 and then I replaced the white space or %20 of the new string for '/'. But you are able to replace it using another ASCII code, for final step I send all to lowercase.  

{{lower(replace(encodeURL(2.Breed); "%20"; "/"))}}