Formula for removing whitespace
- 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
Hi all, is there any formula to remove the extra whitespaces anywhere from the line texts (except cleansing tool), not Trim formula as it only removes extra spaces from left and right but i want to remove extra spaces anywhere places in the line of texts using only the formula. Thanks.
- Labels:
- Transformation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @RajatRehria, you can just use the replace() expression with a space as your target:
Replace([Field],' ','')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If you have longer strings of spaces, you can use RegEx to remove them. Trim(REGEX_Replace([Text],"\s+"," "))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Pls show the Regex formula as well, when using the !Startswith(Trim(REGEX_Replace([Row-1:Data],"\s+"," ")) then getting formula error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@RajatRehria RegEx formula is included in the original post, it is:
Trim(REGEX_Replace([Text],"\s+"," "))
You've included !Startswith in your formula, which isn't necessary for removing the spaces and you haven't included enough parameters: StartsWith(String, Target)
