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
Shivani BankarShivani Bankar 

how to check is input contact name is string or not?

hello,
i want to check contact name which is inserted is string or not using apex
Best Answer chosen by Shivani Bankar
SandhyaSandhya (Salesforce Developers) 
Hi,

You can use
 isAlpha()
isAlphanumeric()
isNumeric() methods

refer below link.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm
 
https://salesforce.stackexchange.com/questions/43778/check-if-an-input-is-numeric-or-not

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
 
Best Regards
Sandhya
 

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi,

You can use
 isAlpha()
isAlphanumeric()
isNumeric() methods

refer below link.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm
 
https://salesforce.stackexchange.com/questions/43778/check-if-an-input-is-numeric-or-not

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
 
Best Regards
Sandhya
 
This was selected as the best answer
Shivani BankarShivani Bankar
Hello,
Thanks it works for me