Skip to main content

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?

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


Reply