Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Removing special characters from at text string

Updated: 25 May 2010 | 2 comments
Aryanos's picture
0 0 Votes
Login to vote
This issue has been solved. See solution.

Does anyone know how to strip special characters such as $,", *,&, #, etc. from a text variable? I am getting some errors when trying to create the title of a PDF with those characters in the text string. The title is inputted from our users they can put anything they want in the title even if there is a label message asking them not to put these characters in the title. I tried playing with the Text Contains and Strip Characters From Text components on the Submit button Custom Validation section but it doesn't list any variables to select for the end component. This way would also mean that I would have to check for each special character as well. Has anyone encountered this problem before or know of a better solution?

discussion Filed Under:

Comments

reecardo's picture
30
Sep
2009
2 Votes +2
Login to vote

Repeated calls to the "Strip

Repeated calls to the "Strip Characters... " component is the way to go. You can hook up the output variable to be the same process variable as the input variable passed to this component; that way the same variable on the stream gets sanitized.

You could define the constant array of the offending characters with "Add New Data Element", then call a "For Each Item In Collection" component on that array looping through the "Strip Characters..." comp to make it cleaner.

Aryanos's picture
30
Sep
2009
0 Votes 0
Login to vote

Thanks reecardo

Thanks reecardo, I'll test it out. The second way you suggested might be the best and cleanest way to go.

I like my beats fast and my bass down low