Friday, 14 June 2013

String operations

1- to string is a function and it is too easy just look at the prog
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
 class ge{

   public static void main(String args[]){
      Integer x = 5;

      System.out.println(x.toString());  //prints 5
      System.out.println(Integer.toString(12)); //prints 12
   }
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
Seriously telling i dont know why it is named to string when it just prints the integer of your choice instead of one initialised
2-'Startswith" this function just checks whether the string you have entered or user has entered begins with the word you specify or not
Ends with perform the exact opposite function

concider the example
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
 class vf{

   public static void main(String args[]){
      String a=("this is a good work");
    boolean b;
b=a.startsWith("this");//prints true on the screen
b=a.startsWith("this");// prints false on screen
b=a.endsWith("work");prints true on the screen
b=a.endsWith("this");
System.out.println(b);
System.out.println(b);
System.out.println(b);
System.out.println(b);
   }
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

No comments:

Post a Comment