Jump to content

Recommended Posts

Posted
I have a project where a "Partner Code" is used in 3 places. Two are in body copy and 1 in a URL. Using the "Case selection for a name field Rule" i can get them to print as all caps or lower case where I need them to be. My questions is how do I trim out all spaces. I found how to remove leading and trailing spaces, but I need to remove all spaces incase the end user in Marcom enters it with a space somewhere. Thank You.
Posted

Hi Greg

 

Thanks for the reply. I tried both of the options in the link you provided, but I can't get it to remove a space in the middle of the variable. I need the variable to look like "ABC123" but I'm getting "ABC 123". Thanks

Posted

I bet you're variable is actually returning a non-breaking space character ( ) rather than an actual space. Try this:

return RawTextFromTagged(Field("Partner Code")).replace(/\s/g, '');

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...