Mobile Number validation using Apex in Salesforce

Sample Code:

String tempStr = '9999999999';

if(!Pattern.matches('[0-9]{10}', tempStr)) {                         
    //error msg
    system.debug('Testing');
}

Cheers!!!

No comments:

Post a Comment