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)

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

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