How to remove all the formats from Phone Number in Salesforce?

Sample Code:

  1. String num = '(123) 456-7894';  
  2. system.debug( num.replaceAll( '[^0-9]''' ) );  

Debug Log:


No comments:

Post a Comment