Removing special characters from at text string
Updated: 25 May 2010 | 2 comments
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
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.
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
Would you like to reply?
Login or Register to post your comment.