Name | Signature and Synopsis |
---|---|
append | Object append(Object stringBuffer, String stringToAppend) Appends strings to the buffer passed to it. |
clearBuffer | void clearBuffer(Object stringBuffer) Clears contents of the buffer passed to it. |
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 |
convertBufferToString | String convertBufferToString(Object stringBuffer) Appends strings to the buffer passed to it. |
convertByteArrayToString | String convertByteArrayToString(Object bytesObject, String encoding) A faster way of converting a {@link byte[]} to String
object.
This is especially useful when the buffer sizes are very large, where {@link String#getBytes(String)} is not optimal. |
createBuffer | Object createBuffer(int size) Creates a new buffer to which strings can be appended instead of concat. |
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. |
format | String format(String message, Object... arguments) Returns the message string formatted with arguments. |
getBytes | Object getBytes(String s1, String charsetName) Encodes a string to a sequence of {@link byte[]} using the named charset. |
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"}. |
split2 | String[] split2(String str, String regex, int limit) Splits this string around matches of the given regular expression. The limit parameter controls the number of times the pattern is applied and therefore affects the length of the resulting array. If the limit n is greater than zero then the pattern will be applied at most n - 1 times, the array's length will be no greater than n, and the array's last entry will contain all input beyond the last matched delimiter. If n is non-positive then the pattern will be applied as many times as possible and the array can have any length. If n is zero then the pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded . e.g. String.split2("This|is|a|test", "\\|",4) returns a String[] of {"This", "is", "a", "test"}. e.g. String.split2("##", "#") returns an empty String[] and String.split2("##", "#", -1) returns {"","",""} |
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 | String 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. |