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:
mystring.touppercase();

similarly you can also convert from upper case to lower case as below:
mystring.tolowecase();
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.

1 comment:

  1. Thhis piece of writing will heelp the internet viewers for creating new website orr
    even a weblog from start to end.

    My blog post: sales

    ReplyDelete