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
rajgopal10rajgopal10 

Can it possible to find out capital letter or small letters for a record in salesforce

Hi,

I have one object as Policy, in that object having policy number field. 
in that field upper case and lower case letters are there.So here i want to know how many policy numbers having small letters.
Is it possible in salesforce ?
Jerome RussJerome Russ
Hello,

You could use Regex you to do this. The syntax is quite easy:

/[a-z]/g

It will match any lowercase letters globally in the string.

For example:
https://regex101.com/r/tN4lU7/1
Thomas.SmithThomas.Smith
Hey,

You could also use the methods provided in the String class. They are:
  • isAllLowerCase()
    Returns true if all characters in the current String are lowercase; otherwise, returns false.
  • isAllUpperCase()
    Returns true if all characters in the current String are uppercase; otherwise, returns false.
Hope this helps!