How to remove spaces from String?

I want to combine two expressions to create a bucket in aws. The bucket name cannot have any spaces. How would I remove spaces from the strings?

ex. Bucket Name: {{ $(‘Merge’).item.json.Client }}-{{ $(‘Merge’).item.json[‘Title of Project’] }} |
OUTPUT would be: New York-Marketing Campaign
OUTPUT should be: NewYork-MarketingCampaign

{{ $('Merge').item.json.Client.replaceAll(" ", "") }}-{{ $('Merge').item.json['Title of Project'].replaceAll(" ", "") }}

replaceAll() demo

"a b c".replaceAll(" ", "") => "abc"
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.