MarcomCentral (PTI) and FusionPro User Communities

MarcomCentral (PTI) and FusionPro User Communities (http://forums.pti.com/index.php)
-   Formatting Text (http://forums.pti.com/forumdisplay.php?f=32)
-   -   Trim all space's (http://forums.pti.com/showthread.php?t=5153)

bkurzbuch June 13th, 2018 10:04 AM

Trim all space's
 
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.

GreggRusson June 13th, 2018 10:17 AM

Re: Trim all space's
 
http://forums.pti.com/showthread.php?p=20745#poststop

bkurzbuch June 13th, 2018 11:11 AM

Re: Trim all space's
 
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

step June 14th, 2018 07:13 PM

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

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


All times are GMT -7. The time now is 04:25 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.