cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
davidstone
Level 8

Strip all punctuation from a text input

I'm trying to allow my users to paste whole paragraphs of text into a text box, which I then need to parse without any punctuation. I'm happy with the parsing, but not sure of the best way to remove punctuation.

 

Looking at the Substitute function, and thinking back to my InfoPath days, it doesn't let you replace characters by position. So for example I can't list all the characters I want to remove and 'replace' them with a blank string.

 

I guess I could nest a bunch of substitutes as below, but this feels inefficient.

 

Substitute(Substitute(Substitute(TextInput1.Text, ".", ""), ",", ""), ";", ""), etc.....

 

Any thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Mike8
Level 10

Re: Strip all punctuation from a text input

2 REPLIES 2
Highlighted
Mike8
Level 10

Re: Strip all punctuation from a text input

davidstone
Level 8

Re: Strip all punctuation from a text input

Instant solution!

 

In case anyone finds this, save yourself a hop with the following:-

 

Concat(Filter(Split(TextInput1.Text,""),IsMatch(Result, "^[a-zA-Z0-9]*$")),Result)