Convert String To Lowercase And Uppercase In Salesforce Apex

Salesforce provides a number of methods to manipulate strings in apex. You can actually play with strings in apex using these methods. Lets see how we can convert a string to a upper case and lower case in the example below.

toLowerCase(): method is to convert all of the characters in the String to lowercase.

String name = 'Biswajeet Samal';
System.debug('Lowercase-' + name.toLowercase());

toUpperCase(): method is to convert all of the characters in the String to uppercase.

String name = 'Biswajeet Samal';
System.debug('Uppercase-' + name.toUppercase());