How to take out blank spaces within a string
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello everyone,
I want to delete blank spaces within a string. For example, I want to take out blank spaces in the following string: "A & B" and get "A&B".
Can anyone help? Thank you so much!
Solved! Go to Solution.
- Labels:
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Take your pick...
ReplaceChar([text],’ ‘,’’)
Regex_Replace([text],’\s’,’’)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Great answer. What if there was "10 A & B" and would like to see "10 A&B"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
REGEX_REPLACE([Text], '\s?(&)\s?', '$1')
This would work to remove spaces found before and/or after the marked group, which is only the "&" char, and replacing that found matches with the marked group, which is the $1 in the 3rd param. If it's required that a space be found before and after, remove the ?.
Jimmy
Teknion Data Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Good afternoon!
I am trying to figure out the correct formula to remove the extra space in the full name. I have a screenshot of what the name looks like before, and the second screenshot is how I want my end result to look. Any advice is greatly appreciated!
Lorianne Spurr |
LorianneSpurr |
Thanks,
Erica
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @EricaNHenk
Not sure I fully understand your need. You mention that you want to remove extra space, which I would have interpreted as replacing 2 or more consecutive spaces with a single space, but the screenshots you shared suggest that you want to remove ALL spaces from the text string, in which case, the solution on this post should satisfy that need.
If it's not working, can you describe what you're seeing when the suggested expressions are attempted?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This does not work for me.
