Skip to main content
Solved

Clearing all special characters expect defined special characters


In the above image I want to clear all special characters expect .(dot) As their can be any thing in place of  ! number may have *, &, %, $, etc. I tried it using trashnondigit() function but it will remove all the characters from the number, Is their a way to do it?

Best answer by Adrian Anderson

Hi ​@Anurag choube .

The substituteAll() function might be helpful here. It takes a regular expression as the substitution pattern and can be used in lots of these cases.

For example, this will remove all non-digits, except for dots and hyphens (allowing for negative numbers as input):

substituteAll( '([^0-9\\.\\-])', '', value )

Let us know if this helps.

Kind regards,
Adrian

View original

Forum|alt.badge.img+1

Hi ​@Anurag choube .

The substituteAll() function might be helpful here. It takes a regular expression as the substitution pattern and can be used in lots of these cases.

For example, this will remove all non-digits, except for dots and hyphens (allowing for negative numbers as input):

substituteAll( '([^0-9\\.\\-])', '', value )

Let us know if this helps.

Kind regards,
Adrian


Thank you so much ​@Adrian Anderson  it worked.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings