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
Mike8
Level 10

Re: Strip all punctuation from a text input

2 REPLIES 2
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)

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 242 members 5,367 guests
Please welcome our newest community members: