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?

2 ACCEPTED SOLUTIONS

Accepted Solutions
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)

View solution in original post

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

View solution in original post

DevinFlickinger
Level: Powered On

Re: Strip all punctuation from a text input

@davidstone VERY HAPPY you shared it here, because hopping over to that other page led to: Access Denied - You do not have sufficient privileges for this resource or its parent to perform this action.

 

Not sure why that page is dead/inaccessible

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 (Last 30 Days)
Users online (4,711)