Name | Signature and Synopsis |
---|---|
compareTo | int compareTo (String s1, String s2) Compares two strings lexicographically. |
compareToIgnoreCase | int compareToIgnoreCase (String s1, String s2) Compares two strings lexicographically, ignoring case differences. |
concat | String concat (String s1, String s2) Concatenates the two argument strings and returns the resulting String. |
contains | boolean contains (String s1, String s2) Tests if the String s1 contains the String s2 |
endsWith | boolean endsWith (String s1, String suffix) Tests if the String s1 ends with the specified suffix. |
equals | boolean equals (String s1, String s2) Compares two Strings and returns a boolean indicating whether they are equal. |
hashCode | int hashCode (String s1) Returns a hash code for the passed String. |
indexOfString | int indexOfString (String s1, int fromIndex, String s2) Returns the index within this string of the first occurrence of the specified substring. |
lastIndexOfString | int lastIndexOfString (String s1, int fromIndex, String s2) Returns the index within the String s1 of the
last occurrence of the String s2 . |
left | String left (String s1, int length) Returning a String containing the first length characters of the string s1 . |
length | int length (String s1) Returns the length of the String passed in. |
matches | boolean matches (String s1, String regex) Tells whether or not this string matches the given regular expression. |
pad | String pad (String s1, int length, String padCharacter) Returns a string padded to the indicated length with the pad character. |
padFront | String padFront(String s1, int length, String padCharacter) Returns a string front-padded to the indicated length with the pad character. |
regionMatches | boolean regionMatches (boolean ignoreCase, String s1, int offset1, String s2, int offset2, int length) Tests if two string regions are equal. |
replaceAll | String replaceAll (String s1, String regex, String replacement) Replaces each substring of this string that matches the given regular expression with the given replacement. |
replaceFirst | String replaceFirst (String s1, String regex, String replacement) Replaces the first substring of this string that matches the given regular expression with the given replacement. |
right | String right (String s1, int length) Returning a String containing the last length characters of the string s1 . |
split | String[] split(String str, String regex) Splits this string around matches of the given regular expression. Trailing empty strings are not included in the resulting array. e.g. String.split("This|is|a|test", "\\|") returns a String[] of {"This", "is", "a", "test"}. |
startsWith | boolean startsWith (String s1, String prefix) Tests if the String s1 ends with the specified prefix. |
substring | String substring (String s1, int beginIndex, int endIndex) Returns a new string that is a substring of this string. |
substringAfter | substringAfter (String s1, String s2) Return a String after the first occurence of the String s2 in String s1 |
substringBefore | String substringBefore (String s1, String s2) Return a String before the first occurence of the String s2 in String s1 |
toLowerCase | String toLowerCase (String s1) Converts all of the characters in the String passed to lower case using the rules of the default locale. |
toUpperCase | String toUpperCase (String s1) Converts all of the characters in the String passed to upper case using the rules of the default locale. |
tokenize | String[] tokenize(String str, String delimiter) Breaks an input string into tokens, returning tokens in a String[]. e.g. String.tokenize("This is a test", null) returns a String[] of {"This", "is", "a", "test"}. |
trim | String trim(String str) Returns a copy of the string, with leading and trailing whitespace omitted. |
valueOfBoolean | String valueOfBoolean (boolean b) Returns a String representation of the boolean passed in. |
valueOfDouble | String valueOfDouble (double d) Returns a String representation of the double passed in. |
valueOfInt | String valueOfInt (int i) Returns a String representation of the int passed in. |
valueOfLong | String valueOfLong (long l) Returns a String representation of the long passed in. |