convert string to uppercase salesforce

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 in the example below.
Say you have a string variable mystring and you want to convert this into upper case just use the method as varaibalename.method name as below:

similarly you can also convert from upper case to lower case as below:
swapcase helps in swapping the cases of each character in the string.
for example your mystring is "aGttLoP"
mystring.swapcase(); would give you "AgTTlOp"
There are lot of methods for manipulating string these were just few example to show how to use them.

No comments:

Post a Comment