+ Start a Discussion
Jyosi jyosiJyosi jyosi 

Regex Expression in salesforce.com

Hello Every one
I am integarting with the other product,The phone number in salesforce.com is using (614)-903-5444
But i need to parse has 614-903-5444

How to remove the values.

Thanks a lot

Regards
Jyo


 
Best Answer chosen by Jyosi jyosi
Chidambar ReddyChidambar Reddy
If it is incase of Apex
 
string modifiedPhone = Phone.replaceAll('(', '').replaceAll(')','');

Incase of Formula fields, you can use 
SUBSTITUTE

 

All Answers

Chidambar ReddyChidambar Reddy
Hi Jyosi,

Where do you want this? in Formula fields or in Apex?
Chidambar ReddyChidambar Reddy
If it is incase of Apex
 
string modifiedPhone = Phone.replaceAll('(', '').replaceAll(')','');

Incase of Formula fields, you can use 
SUBSTITUTE

 
This was selected as the best answer
Jyosi jyosiJyosi jyosi
Thanks a lot

used this expression

replaceAll('\\(', '').replaceAll('\\)','');