Friday 5 April 2013

Some Common Methods of String Class in Java



The following methods are some of the more commonly used methods in the String
Class.

  1. charAt() Returns the character located at the specified index
  2.  concat() Appends one String to the end of another ( "+" also works)
  3.  equalsIgnoreCase() Determines the equality of two Strings, ignoring case
  4.  length() Returns the number of characters in a String
  5.  replace() Replaces occurrences of a character with a new character
  6.  substring() Returns a part of a String
  7.  toLowerCase() Returns a String with uppercase characters converted
  8.  toString() Returns the value of a String
  9.  toUpperCase() Returns a String with lowercase characters converted
  10.  trim() Removes whitespace from the ends of a String

No comments:

Post a Comment