Remove spacing from string

Post

Posted
Rating:
#3578 (In Topic #680)
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
I'm trying to make a string containing spaces output without any spaces.

Example: this is a test string

Output: thisisateststring

I checked out $TRIM and $DEEP_CLEAN and thought these would do the trick, but I guess I'm not fully understanding the definition of "white-space".

Any suggestions?
Online now: No Back to the top

Post

Posted
Rating:
#3581
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
If that's really what's happening, it must be happening in some very specific context (let us know what exactly).
HTML won't show runs of multiple white-spaces (it'll just show 1 instead), but it won't strip them all.

If you just miswrote, and it's only reducing multiple white-spaces to 1, then applying the CSS 'white-space: pre' will make them show, although this also stops word-wrapping.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#3582
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
I mis-read.

You need to use the 'REPLACE' symbol to literally replace the space character with blank.

OTTOMH…

{$REPLACE, ,,{SOME_PARAMETER}}


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#3583
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’

Chris Graham said

I mis-read.

You need to use the 'REPLACE' symbol to literally replace the space character with blank.

OTTOMH…

{$REPLACE, ,,{SOME_PARAMETER}}

I'll try that Chris, thanks!
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Forum statistics:
  • 2,052 topics, 7,195 posts, 10,830 members
  • Our newest member is Customcollective
Back to Top