java.lang.String
The String class represents character strings. All string literals in Java programs, such as "abc", are implemented as instances of this class. Strings are constant; their values cannot be changed after they are created. String buffers support mutable strings. Because String objects are immutable they can be shared.
Some Methods of String class
toString(): This object (which is already a string!) is itself returned.
toUpperCase(): This method converts all of the characters in this String to uppercase using the rules of the default locale.
toUpperCase(Locale locale): This method converts all of the characters in this String to uppercase using the rules of the given Locale. Case mapping is based on the Unicode Standard version specified by the Character class.
translateEscapes(): This method returns a string whose value is this string, with escape sequences translated as if in a string literal.
trim(): This method returns a string whose value is this string, with all leading and trailing space removed
String.valueOf(boolean b): This method returns the string representation of the boolean argument.
String.valueOf(char c): This method returns the string representation of the char argument.
String.valueOf(char[] data): This method returns the string representation of the char array argument. The contents of the character array are copied; subsequent modification of the character array does not affect the returned string.
String.valueOf(char[] data, int offset, int count): his method returns the string representation of a specific subarray of the char array argument.
String.valueOf(double d): This method returns the string representation of the double argument.
String.valueOf(float f): This method returns the string representation of the float argument.
String.valueOf(int i): This method returns the string representation of the int argument.
String.valueOf(long l): This method returns the string representation of the long argument.
Some more Methods of String Part - I
Some more Methods of String Part - II
Some more Methods of String Part -III
No comments:
Post a Comment