Write a program in java to demonstrate startsWith() and endsWith() methods?

class StringWith

{

                public static void main(String arg[])

                {

                                String s="india";

                                System.out.println(s.startsWith("i"));

                                System.out.println(s.endsWith("i"));

                }

}

startsWith() and endsWith() methods.PNG

, , , , , ,

Leave a Reply