DEV Community

hema latha
hema latha

Posted on

String convert uppercase my name

public static void main(String[] args) {
        // TODO Auto-generated method stub
   String name= "hemalatha";
   System.out.println(name.toUpperCase());
    }

out put - HEMALATHA


-----------------

public static void main(String[] args) {
        // TODO Auto-generated method stub
   String name= "hemalatha";
   //System.out.println(name.toUpperCase());
    for(int i=0; i<name.length(); i++)
    {
        char ch = name.charAt(i);
        {
        System.out.print((char)(ch-32));
    }



    }}}

out put --  HEMALATHA
Enter fullscreen mode Exit fullscreen mode




Enter fullscreen mode Exit fullscreen mode

Top comments (0)