function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dipti DDipti D 

Phone number Parenthesis issue

Hi Friends, NEED help ASAP. Please.
I am trying to make a code change. Just one line. 
While passing a phone number, earlier we were passing all dashes as blanks. Now we need to exclude paranthesis as well.
i.e. (904) 111-2244 should be passed as 9041112244
How can i acieve this?
My old code is this. 
?CaseRecord.Phone__c.replaceAll('-',''):'');      
If i give double quotes as per some developer form suggestions, I get "No viable characterr "" error"
SKolakanSKolakan

You can use Regex like this:
 
?CaseRecord.Phone__c.replaceAll('[^0-9.]','' );

This will remove all characters except numeric.