Monday, 11 March 2013

34.Program for convert string in uppercase or lowercase in java



import java.io.*;
class buffer1
{
            public static void main(String args[])
            {
                        try
                        {
                                                InputStreamReader ir=new InputStreamReader(System.in);
                                                BufferedReader in=new BufferedReader(ir);
                                                System.out.println("Enter String:");
                                                String s=in.readLine();
                                                System.out.println("String:"+s);
                                                System.out.println("Length:"+s.length());
                                                System.out.println("Upper String:"+s.toUpperCase());
                                                System.out.println("Lower case:"+s.toLowerCase());
                                                System.out.println(s.replace('i','t'));
                        }
                        catch(Exception e)
                        {
                                    System.out.println("Exception:"+e);
                        }
            }
}

No comments:

Post a Comment