|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--ViolinStrings.Strings
The Strings class provides a number of useful string manipulation
methods. It cannot be instantiated.
You would typically use it in the following manner:
String s = "abcdefg";
String x = Strings.leftJustify(s, 20);
Some of the methods just call the equivalent methods from java.lang.String. They are provided to collect all string methods in one place.
String,
StringBuffer,
java.lang.Character| Method Summary | |
static java.lang.String |
center(java.lang.String s,
int len)
Centers the string within a string of the specified length, padding it with blanks. |
static java.lang.String |
center(java.lang.String s,
int len,
char pad)
Centers the string within a string of the specified length, padding it with the specified character. |
static java.lang.String |
change(java.lang.String s,
char oldc,
char newc)
Changes occurrences of a specified character to a replacement character. |
static java.lang.String |
change(java.lang.String s,
char oldc,
char newc,
int start)
Changes occurrences of a specified character to a replacement character. |
static java.lang.String |
change(java.lang.String s,
char oldc,
char newc,
int start,
boolean ignoreCase)
Changes occurrences of a specified character to a replacement character. |
static java.lang.String |
change(java.lang.String s,
char oldc,
char newc,
int start,
int maxChanges)
Changes occurrences of a specified character to a replacement character. |
static java.lang.String |
change(java.lang.String s,
char oldc,
char newc,
int start,
int maxChanges,
boolean ignoreCase)
Changes occurrences of a specified character to a replacement character. |
static java.lang.String |
change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp)
Changes occurrences of a specified pattern to a replacement string. |
static java.lang.String |
change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
boolean ignoreCase)
Changes occurrences of a specified pattern to a replacement string. |
static java.lang.String |
change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
int start)
Changes occurrences of a specified pattern to a replacement string. |
static java.lang.String |
change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
int start,
boolean ignoreCase)
Changes occurrences of a specified pattern to a replacement string. |
static java.lang.String |
change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
int start,
int maxChanges)
Changes occurrences of a specified pattern to a replacement string. |
static java.lang.String |
change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
int start,
int maxChanges,
boolean ignoreCase)
Changes occurrences of a specified pattern to a replacement string. |
static int |
compare(java.lang.String s1,
java.lang.String s2)
Compares two strings. |
static boolean |
contains(java.lang.String s,
java.lang.String search)
Returns true if the specified search string is contained in the original string. |
static boolean |
contains(java.lang.String s,
java.lang.String search,
boolean ignoreCase)
Returns true if the specified search string is contained in the original string. |
static java.lang.String |
copies(java.lang.String s,
int nCopies)
Returns a string consisting of the specified number of copies of the input string. |
static boolean |
endsWith(java.lang.String s,
java.lang.String suffix)
Returns true if the string ends with the specified suffix. |
static boolean |
endsWith(java.lang.String s,
java.lang.String suffix,
boolean ignoreCase)
Returns true if the string ends with the specified suffix. |
static boolean |
equals(char c1,
char c2,
boolean ignoreCase)
Checks if two characters are equal. |
static boolean |
equals(java.lang.String s1,
java.lang.String s2,
boolean ignoreCase)
Checks if two strings are equal. |
static int |
indexOf(java.lang.String s,
char c)
Returns the index of the first ocurrence of the specified character. |
static int |
indexOf(java.lang.String s,
char c,
boolean ignoreCase)
Returns the index of the first ocurrence of the specified character. |
static int |
indexOf(java.lang.String s,
char c,
int start)
Returns the index of the first ocurrence of the specified character. |
static int |
indexOf(java.lang.String s,
char c,
int start,
boolean ignoreCase)
Returns the index of the first ocurrence of the specified character, starting at the specified position. |
static int |
indexOf(java.lang.String s,
java.lang.String c)
Returns the index of the first ocurrence of the specified string. |
static int |
indexOf(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
Returns the index of the first ocurrence of the specified string, starting at the beginning of the string. |
static int |
indexOf(java.lang.String s,
java.lang.String c,
int start)
Returns the index of the first ocurrence of the specified string. |
static int |
indexOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
Returns the index of the first ocurrence of the specified string. |
static int |
indexOfAnyBut(java.lang.String s,
java.lang.String c)
Returns the index of the first character that is not contained in the specified set of characters. |
static int |
indexOfAnyBut(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
Returns the index of the first character that is not contained in the specified set of characters. |
static int |
indexOfAnyBut(java.lang.String s,
java.lang.String c,
int start)
Returns the index of the first character that is not contained in the specified set of characters. |
static int |
indexOfAnyBut(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
Returns the index of the first character that is not contained in the specified set of characters. |
static int |
indexOfAnyOf(java.lang.String s,
java.lang.String c)
Returns the index of the first character that is contained in the specified set of characters. |
static int |
indexOfAnyOf(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
Returns the index of the first character that is contained in the specified set of characters. |
static int |
indexOfAnyOf(java.lang.String s,
java.lang.String c,
int start)
Returns the index of the first character that is contained in the specified set of characters. |
static int |
indexOfAnyOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
Returns the index of the first character that is contained in the specified set of characters. |
static int |
indexOfPhrase(java.lang.String s,
java.lang.String p,
int startWord)
Returns the index of the first occurrence of the specified phrase within the string. |
static int |
indexOfPhrase(java.lang.String s,
java.lang.String p,
int startWord,
boolean ignoreCase)
Returns the index of the first occurrence of the specified phrase within the string. |
static int |
indexOfWord(java.lang.String s,
int wordNum)
Returns the index of the first character of the specified nth word within the string. |
static java.lang.String |
insert(java.lang.String s,
java.lang.String ins,
int start)
Inserts a string after the specified position. |
static java.lang.String |
insert(java.lang.String s,
java.lang.String ins,
int start,
char pad)
Inserts a string after the specified position. |
static boolean |
isAbbreviationOf(java.lang.String s,
java.lang.String full,
boolean ignoreCase)
Returns true if the string is a valid abbreviation of another string. |
static boolean |
isAbbreviationOf(java.lang.String s,
java.lang.String full,
int minLength)
Returns true if the string is a valid abbreviation of another string. |
static boolean |
isAbbreviationOf(java.lang.String s,
java.lang.String full,
int minLength,
boolean ignoreCase)
Returns true if the string is a valid abbreviation of another string. |
static boolean |
isDigit(java.lang.String s)
Returns true if the string consists of digits. |
static boolean |
isIdentifierIgnorable(java.lang.String s)
Returns true if the string consists of ignorable characters in a Java identifier or a Unicode identifier. |
static boolean |
isISOControl(java.lang.String s)
Returns true if the string consists of ISO control characters. |
static boolean |
isJavaIdentifier(java.lang.String s)
Returns true if the string is a valid Java identifier. |
static boolean |
isLetter(java.lang.String s)
Returns true if the string consists of letters. |
static boolean |
isLetterOrDigit(java.lang.String s)
Returns true if the string consists of letters or digits. |
static boolean |
isLike(java.lang.String s,
java.lang.String pattern)
Returns true if the string matches the specified pattern. |
static boolean |
isLike(java.lang.String s,
java.lang.String pattern,
int start)
Returns true if the string matches the specified pattern. |
static boolean |
isLike(java.lang.String s,
java.lang.String pattern,
int start,
boolean ignoreCase)
Returns true if the string matches the specified pattern. |
static boolean |
isLike(java.lang.String s,
java.lang.String pattern,
int start,
char wAnySeq,
char wAnyChar,
boolean ignoreCase)
Returns true if the string matches the specified pattern. |
static boolean |
isLowerCase(java.lang.String s)
Returns true if the string consists of lowercase characters. |
static boolean |
isSpaceChar(java.lang.String s)
Returns true if the string consists of Unicode space characters. |
static boolean |
isTitleCase(java.lang.String s)
Returns true if the string consists of title case characters. |
static boolean |
isUnicodeIdentifier(java.lang.String s)
Returns true if the string is a valid Unicode identifier. |
static boolean |
isUpperCase(java.lang.String s)
Returns true if the string consists of uppercase characters. |
static boolean |
isWhitespace(java.lang.String s)
Returns true if the string consists of whitespace characters. |
static int |
lastIndexOf(java.lang.String s,
char c)
Returns the index of the last ocurrence of the specified character. |
static int |
lastIndexOf(java.lang.String s,
char c,
int start)
Returns the index of the last ocurrence of the specified character. |
static int |
lastIndexOf(java.lang.String s,
char c,
int start,
boolean ignoreCase)
Returns the index of the last ocurrence of the specified character. |
static int |
lastIndexOf(java.lang.String s,
java.lang.String c)
Returns the index of the last ocurrence of the specified string. |
static int |
lastIndexOf(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
Returns the index of the last ocurrence of the specified string. |
static int |
lastIndexOf(java.lang.String s,
java.lang.String c,
int start)
Returns the index of the last ocurrence of the specified string. |
static int |
lastIndexOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
Returns the index of the last ocurrence of the specified string. |
static int |
lastIndexOfAnyBut(java.lang.String s,
java.lang.String c)
Returns the index of the last character that is not contained in the specified set of characters. |
static int |
lastIndexOfAnyBut(java.lang.String s,
java.lang.String c,
int start)
Returns the index of the last character that is not contained in the specified set of characters. |
static int |
lastIndexOfAnyBut(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
Returns the index of the last character that is not contained in the specified set of characters. |
static int |
lastIndexOfAnyOf(java.lang.String s,
java.lang.String c)
Returns the index of the last character that is contained in the specified set of characters. |
static int |
lastIndexOfAnyOf(java.lang.String s,
java.lang.String c,
int start)
Returns the index of the last character that is contained in the specified set of characters. |
static int |
lastIndexOfAnyOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
Returns the index of the last character that is contained in the specified set of characters. |
static java.lang.String |
leftJustify(java.lang.String s,
int len)
Left-justifies the string in a string of the specified length. |
static java.lang.String |
leftJustify(java.lang.String s,
int len,
char pad)
Left-justifies the string in a string of the specified length. |
static int |
numWords(java.lang.String s)
Returns the number of words in the string. |
static int |
occurrencesOf(java.lang.String s,
java.lang.String c)
Returns the number of occurrences of the specified string. |
static int |
occurrencesOf(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
Returns the number of occurrences of the specified string. |
static int |
occurrencesOf(java.lang.String s,
java.lang.String c,
int start)
Returns the number of occurrences of the specified string. |
static int |
occurrencesOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
Returns the number of occurrences of the specified string. |
static java.lang.String |
overlayWith(java.lang.String s,
java.lang.String o,
int start)
Replaces part of the string with the specified string, starting at a specified position. |
static java.lang.String |
overlayWith(java.lang.String s,
java.lang.String o,
int start,
char pad)
Replaces part of the string with the specified string, starting at a specified position. |
static java.lang.String |
remove(java.lang.String s,
int start,
int numChars)
Removes the specified number of characters from the string, starting at the specified position. |
static java.lang.String |
removeWords(java.lang.String s,
int startWord,
int numWords)
Removes the specified number of words from the string, starting with the specified word number. |
static java.lang.String |
reverse(java.lang.String s)
Reverses the sequence of characters contained in the string. |
static java.lang.String |
rightJustify(java.lang.String s,
int len)
Right-justifies the string in a string of the specified length. |
static java.lang.String |
rightJustify(java.lang.String s,
int len,
char pad)
Right-justifies the string in a string of the specified length. |
static java.lang.String[] |
split(java.lang.String s)
Return an array of the constituent words of a string. |
static java.lang.String[] |
split(java.lang.String s,
int limit)
Return an array of (at most) the first limit constituent words of a string. |
static boolean |
startsWith(java.lang.String s,
java.lang.String prefix)
Returns true if the string starts with the specified prefix. |
static boolean |
startsWith(java.lang.String s,
java.lang.String prefix,
boolean ignoreCase)
Returns true if the string starts with the specified prefix. |
static boolean |
startsWith(java.lang.String s,
java.lang.String prefix,
int start)
Returns true if the string starts with the specified prefix. |
static boolean |
startsWith(java.lang.String s,
java.lang.String prefix,
int start,
boolean ignoreCase)
Returns true if the string starts with the specified prefix. |
static java.lang.String |
strip(java.lang.String s,
char c)
Strips the specified character from both ends of the string. |
static java.lang.String |
strip(java.lang.String s,
char c,
boolean ignoreCase)
Strips the specified character from both ends of the string. |
static java.lang.String |
strip(java.lang.String s,
java.lang.String c)
Strips the specified characters from both ends of the string. |
static java.lang.String |
strip(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
Strips the specified characters from both ends of the string. |
static java.lang.String |
stripBlanks(java.lang.String s)
Strips white space characters from both ends of the string. |
static java.lang.String |
stripLeading(java.lang.String s,
char c)
Strips the specified leading character. |
static java.lang.String |
stripLeading(java.lang.String s,
char c,
boolean ignoreCase)
Strips the specified leading character. |
static java.lang.String |
stripLeading(java.lang.String s,
java.lang.String c)
Strips the specified leading characters. |
static java.lang.String |
stripLeading(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
Strips the specified leading characters. |
static java.lang.String |
stripLeadingBlanks(java.lang.String s)
Strips leading white space characters. |
static java.lang.String |
stripTrailing(java.lang.String s,
char c)
Strips the specified trailing character. |
static java.lang.String |
stripTrailing(java.lang.String s,
char c,
boolean ignoreCase)
Strips the specified trailing character. |
static java.lang.String |
stripTrailing(java.lang.String s,
java.lang.String c)
Strips the specified trailing characters. |
static java.lang.String |
stripTrailing(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
Strips the specified trailing characters. |
static java.lang.String |
stripTrailingBlanks(java.lang.String s)
Strips trailing white space characters. |
static java.lang.String |
substring(java.lang.String s,
int start)
Returns a substring of the specified string, starting at a specified position, and extending to the end of the string. |
static java.lang.String |
substring(java.lang.String s,
int start,
int len)
Returns a substring of the specified string, starting at a specified position, with the specified length. |
static java.lang.String |
substring(java.lang.String s,
int start,
int len,
char pad)
Returns a substring of the specified string, starting at a specified position, with the specified length. |
static java.lang.String |
subWords(java.lang.String s,
int startWord,
int numWords)
Returns a substring of the string which starts at a specified word and contains the specified number of words. |
static boolean |
toBoolean(java.lang.String s)
Returns true if the string represents the word "true". |
static byte |
toByte(java.lang.String s)
If the string represents a valid byte value, returns this value as a byte. |
static byte |
toByte(java.lang.String s,
int radix)
If the string represents a valid byte value, returns this value as a byte. |
static double |
toDouble(java.lang.String s)
If the string represents a valid double number, returns this number as a double value. |
static float |
toFloat(java.lang.String s)
If the string represents a valid float number, returns this number as a float value. |
static int |
toInt(java.lang.String s)
If the string represents a valid integer number, returns this number as an int value. |
static int |
toInt(java.lang.String s,
int radix)
If the string represents a valid integer number, returns this number as an int value. |
static long |
toLong(java.lang.String s)
If the string represents a valid long integer, returns this number as a long value. |
static long |
toLong(java.lang.String s,
int radix)
If the string represents a valid long integer, returns this number as a long value. |
static java.lang.String |
toLowerCase(java.lang.String s)
Converts the string to lower case. |
static java.lang.String |
toLowerCase(java.lang.String s,
java.util.Locale locale)
Converts the string to lower case using the given Locale. |
static short |
toShort(java.lang.String s)
If the string represents a valid short number, returns this number as a short value. |
static short |
toShort(java.lang.String s,
int radix)
If the string represents a valid short number, returns this number as a short value. |
static java.lang.String |
toTitleCase(java.lang.String s)
Converts the string to titlecase. |
static java.lang.String |
toUpperCase(java.lang.String s)
Converts the string to upper case. |
static java.lang.String |
toUpperCase(java.lang.String s,
java.util.Locale locale)
Converts the string to upper case using the given Locale. |
static java.lang.String |
translate(java.lang.String s,
java.lang.String setin,
java.lang.String setout)
Converts all of the string's characters which are contained in the input set of characters to the corresponding character in the output set of characters. |
static java.lang.String |
translate(java.lang.String s,
java.lang.String setin,
java.lang.String setout,
boolean ignoreCase)
Converts all of the string's characters which are contained in the input set of characters to the corresponding character in the output set of characters. |
static java.lang.String |
translate(java.lang.String s,
java.lang.String setin,
java.lang.String setout,
char pad)
Converts all of the string's characters which are contained in the input set of characters to the corresponding character in the output set of characters. |
static java.lang.String |
translate(java.lang.String s,
java.lang.String setin,
java.lang.String setout,
char pad,
boolean ignoreCase)
Converts all of the string's characters which are contained in the input set of characters to the corresponding character in the output set of characters. |
static java.lang.String |
word(java.lang.String s,
int wordNum)
Returns the nth word in the string. |
static int |
wordIndexOfPhrase(java.lang.String s,
java.lang.String p,
int startWord)
Returns the number of the first word of the first occurrence of the specified phrase within the string. |
static int |
wordIndexOfPhrase(java.lang.String s,
java.lang.String p,
int startWord,
boolean ignoreCase)
Returns the number of the first word of the first occurrence of the specified phrase within the string. |
static java.lang.String |
wordSpace(java.lang.String s,
int spaces)
All whitespace between the words of the string is replaced by the specified number of blanks. |
static java.lang.String |
xRange(char start,
char end)
Builds a string consisting of all characters between 'start' and 'end'. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static java.lang.String center(java.lang.String s,
int len)
s - the original stringlen - the length of the new string
public static java.lang.String center(java.lang.String s,
int len,
char pad)
s - the original stringlen - the length of the new stringpad - the pad character
public static java.lang.String change(java.lang.String s,
char oldc,
char newc)
s - the input stringoldc - the pattern to be replacednewc - the replacement stringjava.lang.string#replace(char, char)
public static java.lang.String change(java.lang.String s,
char oldc,
char newc,
int start)
s - the input stringoldc - the pattern to be replacednewc - the replacement stringstart - the starting position for the search
public static java.lang.String change(java.lang.String s,
char oldc,
char newc,
int start,
boolean ignoreCase)
s - the input stringoldc - the pattern to be replacednewc - the replacement stringstart - the starting position for the searchignoreCase - if true case is ignored when comparing characters
public static java.lang.String change(java.lang.String s,
char oldc,
char newc,
int start,
int maxChanges)
s - the input stringoldc - the pattern to be replacednewc - the replacement stringstart - the starting position for the searchmaxChanges - the maximum number of changes
public static java.lang.String change(java.lang.String s,
char oldc,
char newc,
int start,
int maxChanges,
boolean ignoreCase)
s - the input stringoldc - the pattern to be replacednewc - the replacement stringstart - the starting position for the searchmaxChanges - the maximum number of changesignoreCase - if true case is ignored when comparing characters
public static java.lang.String change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp)
s - the input stringoldp - the pattern to be replacednewp - the replacement string
public static java.lang.String change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
boolean ignoreCase)
s - the input stringoldp - the pattern to be replacednewp - the replacement stringignoreCase - if true case is ignored when comparing characters
public static java.lang.String change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
int start)
s - the input stringoldp - the pattern to be replacednewp - the replacement stringstart - the starting position for the search
public static java.lang.String change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
int start,
boolean ignoreCase)
s - the input stringoldp - the pattern to be replacednewp - the replacement stringstart - the starting position for the searchignoreCase - if true case is ignored when comparing characters
public static java.lang.String change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
int start,
int maxChanges)
s - the input stringoldp - the pattern to be replacednewp - the replacement stringstart - the starting position for the searchmaxChanges - the maximum number of changes
public static java.lang.String change(java.lang.String s,
java.lang.String oldp,
java.lang.String newp,
int start,
int maxChanges,
boolean ignoreCase)
s - the input stringoldp - the pattern to be replacednewp - the replacement stringstart - the starting position for the searchmaxChanges - the maximum number of changesignoreCase - if true case is ignored when comparing characters
public static int compare(java.lang.String s1,
java.lang.String s2)
s1 - the first strings2 - second strings1 is lexicographically less than s2,
and a value greater than
zero if s1 is lexicographically greater than s2.java.lang.string#compareTo(String)
public static boolean contains(java.lang.String s,
java.lang.String search)
s - the original stringsearch - the search stringjava.lang.string#indexOf(String)
public static boolean contains(java.lang.String s,
java.lang.String search,
boolean ignoreCase)
s - the input stringsearch - the search stringignoreCase - if true case is ignored when comparing charactersjava.lang.string#indexOf(String)
public static java.lang.String copies(java.lang.String s,
int nCopies)
s - the input stringnCopies - the number of copiesjava.lang.stringBuffer#append(String)
public static boolean endsWith(java.lang.String s,
java.lang.String suffix)
s - the input stringsuffix - the suffixjava.lang.string#endsWith(String)
public static boolean endsWith(java.lang.String s,
java.lang.String suffix,
boolean ignoreCase)
s - the input stringsuffix - the suffixignoreCase - if true case is ignored when comparing charactersjava.lang.string#endsWith(String),
java.lang.string#regionMatches(boolean, int, String, int, int)
public static boolean equals(char c1,
char c2,
boolean ignoreCase)
c1 - first characterc2 - second characterignoreCase - if true case is ignored when comparing charactersjava.lang.string#equalsIgnoreCase(String)
public static boolean equals(java.lang.String s1,
java.lang.String s2,
boolean ignoreCase)
s1 - first strings2 - second stringignoreCase - if true case is ignored when comparing charactersjava.lang.string#equalsIgnoreCase(String)
public static int indexOf(java.lang.String s,
char c)
s - the string to be inspectedc - the character to be searched forjava.lang.string#indexOf(char)
public static int indexOf(java.lang.String s,
char c,
boolean ignoreCase)
s - the string to be inspectedc - the character to be searched forignoreCase - if true case is ignored when comparing characters
public static int indexOf(java.lang.String s,
char c,
int start)
s - the string to be inspectedc - the character to be searched forstart - the starting position for the searchjava.lang.string#indexOf(char, int)
public static int indexOf(java.lang.String s,
char c,
int start,
boolean ignoreCase)
s - the string to be inspectedc - the character to be searched forstart - the starting position for the searchignoreCase - if true case is ignored when comparing charactersjava.lang.string#indexOf(char, int)
public static int indexOf(java.lang.String s,
java.lang.String c)
s - the string to be inspectedc - the string to be searched forjava.lang.string#indexOf(String)
public static int indexOf(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
s - the string to be inspectedc - the string to be searched forignoreCase - if true case is ignored when comparing characters
public static int indexOf(java.lang.String s,
java.lang.String c,
int start)
s - the string to be inspectedc - the string to be searched forstart - the starting position for the searchjava.lang.string#indexOf(String, int)
public static int indexOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
s - the string to be inspectedc - the string to be searched forstart - the starting position for the searchignoreCase - if true case is ignored when comparing charactersjava.lang.string#indexOf(String, int)
public static int indexOfAnyBut(java.lang.String s,
java.lang.String c)
s - the string to be inspectedc - the set of characters
public static int indexOfAnyBut(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
s - the string to be inspectedc - the set of charactersignoreCase - if true case is ignored when comparing characters
public static int indexOfAnyBut(java.lang.String s,
java.lang.String c,
int start)
s - the string to be inspectedc - the set of charactersstart - the starting position for the search
public static int indexOfAnyBut(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
s - the string to be inspectedc - the set of charactersstart - the starting position for the searchignoreCase - if true case is ignored when comparing characters
public static int indexOfAnyOf(java.lang.String s,
java.lang.String c)
s - the string to be inspectedc - the set of characters
public static int indexOfAnyOf(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
s - the string to be inspectedc - the set of charactersignoreCase - if true case is ignored when comparing characters
public static int indexOfAnyOf(java.lang.String s,
java.lang.String c,
int start)
s - the string to be inspectedc - the set of charactersstart - the starting position for the search
public static int indexOfAnyOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
s - the string to be inspectedc - the set of charactersstart - the starting position for the searchignoreCase - if true case is ignored when comparing characters
public static int indexOfPhrase(java.lang.String s,
java.lang.String p,
int startWord)
s - the input stringp - the phrase to be searched forstartWord - the word number where the search is to start. The
first word has number 0.
public static int indexOfPhrase(java.lang.String s,
java.lang.String p,
int startWord,
boolean ignoreCase)
s - the input stringp - the phrase to be searched forstartWord - the word number where the search is to start. The
first word has number 0.ignoreCase - if true case is ignored when comparing characters
public static int indexOfWord(java.lang.String s,
int wordNum)
s - the input stringwordNum - the number of the word
public static java.lang.String insert(java.lang.String s,
java.lang.String ins,
int start)
s - the input stringins - the string to be insertedstart - the starting position for the insert
public static java.lang.String insert(java.lang.String s,
java.lang.String ins,
int start,
char pad)
s - the input stringins - the string to be insertedstart - the starting position for the insertpad - the pad character
public static boolean isAbbreviationOf(java.lang.String s,
java.lang.String full,
boolean ignoreCase)
s is considered an abbreviation of another string
full if
the string s is a prefix of string full.
You can specify that case should be ignored.s - the string to testfull - the full stringignoreCase - if true case is ignored when comparing characterss is an abbreviation of string full.java.lang.string#regionMatches(boolean, int, String, int, int)
public static boolean isAbbreviationOf(java.lang.String s,
java.lang.String full,
int minLength)
s is considered an abbreviation of another string
full if
the string s is a prefix of string full and its length is at least
minLength.s - the string to testfull - the full stringminLength - the minimum lengths is an abbreviation of string full.
public static boolean isAbbreviationOf(java.lang.String s,
java.lang.String full,
int minLength,
boolean ignoreCase)
s is considered an abbreviation of another string
full if
the string s is a prefix of string full and its length is at least
minLength.
You can specify that case should be ignored.s - the string to testfull - the full stringminLength - the minimum lengthignoreCase - if true case is ignored when comparing characterss is an abbreviation of string full.public static boolean isDigit(java.lang.String s)
s - the input stringjava.lang.Character#isDigit(char).public static boolean isIdentifierIgnorable(java.lang.String s)
s - the input stringjava.lang.Character#isIdentifierIgnorable(char).public static boolean isISOControl(java.lang.String s)
s - the input stringjava.lang.Character#isISOControls(char).public static boolean isJavaIdentifier(java.lang.String s)
s - the input stringjava.lang.Character#isJavaIdentifierStart(char),
java.lang.Character#isJavaIdentifierPart(char).public static boolean isLetter(java.lang.String s)
s - the input stringjava.lang.Character#isLetter(char).public static boolean isLetterOrDigit(java.lang.String s)
s - the input stringjava.lang.Character#isLetterOrDigit(char).
public static boolean isLike(java.lang.String s,
java.lang.String pattern)
s - the string to testpattern - the pattern string
public static boolean isLike(java.lang.String s,
java.lang.String pattern,
int start)
s - the string to testpattern - the pattern stringstart - the starting position
public static boolean isLike(java.lang.String s,
java.lang.String pattern,
int start,
boolean ignoreCase)
s - the string to testpattern - the pattern stringstart - the starting positionignoreCase - if true case is ignored when comparing characters
public static boolean isLike(java.lang.String s,
java.lang.String pattern,
int start,
char wAnySeq,
char wAnyChar,
boolean ignoreCase)
s - the string to testpattern - the pattern stringstart - the starting positionwAnySeq - the wildcard character which matches any sequence of characterswAnyChar - the wildcard character which matches any characterignoreCase - if true case is ignored when comparing characterspublic static boolean isLowerCase(java.lang.String s)
s - the input stringjava.lang.Character#isLowercase(char).public static boolean isSpaceChar(java.lang.String s)
s - the input stringjava.lang.Character#isSpaceChar(char).public static boolean isTitleCase(java.lang.String s)
s - the input stringjava.lang.Character#isTitleCase(char).public static boolean isUnicodeIdentifier(java.lang.String s)
s - the input stringjava.lang.Character#isJavaIdentifierStart(char),
java.lang.Character#isJavaIdentifierPart(char)public static boolean isUpperCase(java.lang.String s)
s - the input stringjava.lang.Character#isUpperCase(char).public static boolean isWhitespace(java.lang.String s)
s - the input stringjava.lang.Character#isWhitespace(char).
public static int lastIndexOf(java.lang.String s,
char c)
s - the string to be inspectedc - the string to be searched forjava.lang.string#lastIndexOf(char)
public static int lastIndexOf(java.lang.String s,
char c,
int start)
s - the string to be inspectedc - the character to be searched forstart - the starting position for the searchjava.lang.string#lastIndexOf(char, int)
public static int lastIndexOf(java.lang.String s,
char c,
int start,
boolean ignoreCase)
s - the string to be inspectedc - the character to be searched forstart - the starting position for the searchignoreCase - if true case is ignored when comparing charactersjava.lang.string#lastIndexOf(char, int)
public static int lastIndexOf(java.lang.String s,
java.lang.String c)
s - the string to be inspectedc - the string to be searched forjava.lang.string#lastIndexOf(String)
public static int lastIndexOf(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
s - the string to be inspectedc - the string to be searched forignoreCase - if true case is ignored when comparing characters
public static int lastIndexOf(java.lang.String s,
java.lang.String c,
int start)
s - the string to be inspectedc - the string to be searched forstart - the starting position for the searchjava.lang.string#lastIndexOf(String, int)
public static int lastIndexOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
s - the string to be inspectedc - the string to be searched forstart - the starting position for the searchignoreCase - if true case is ignored when comparing charactersjava.lang.string#lastIndexOf(String, int)
public static int lastIndexOfAnyBut(java.lang.String s,
java.lang.String c)
s - the string to be inspectedc - the set of characters
public static int lastIndexOfAnyBut(java.lang.String s,
java.lang.String c,
int start)
s - the string to be inspectedc - the set of charactersstart - the starting position for the search
public static int lastIndexOfAnyBut(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
s - the string to be inspectedc - the set of charactersstart - the starting position for the searchignoreCase - if true case is ignored when comparing characters
public static int lastIndexOfAnyOf(java.lang.String s,
java.lang.String c)
s - the string to be inspectedc - the set of characters
public static int lastIndexOfAnyOf(java.lang.String s,
java.lang.String c,
int start)
s - the string to be inspectedc - the set of charactersstart - the starting position for the search
public static int lastIndexOfAnyOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
s - the string to be inspectedc - the set of charactersstart - the starting position for the searchignoreCase - if true case is ignored when comparing characters
public static java.lang.String leftJustify(java.lang.String s,
int len)
s - the input stringlen - the length of the new string
public static java.lang.String leftJustify(java.lang.String s,
int len,
char pad)
s - the input stringlen - the length of the new stringpad - the pad characterpublic static int numWords(java.lang.String s)
s - the input string
public static int occurrencesOf(java.lang.String s,
java.lang.String c)
s - the string to be inspectedc - the string to search forstart - the starting position for the search
public static int occurrencesOf(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
s - the string to be inspectedc - the string to search forignoreCase - if true ignore case when comparing characters
public static int occurrencesOf(java.lang.String s,
java.lang.String c,
int start)
s - the string to be inspectedc - the string to search forstart - the starting position for the search
public static int occurrencesOf(java.lang.String s,
java.lang.String c,
int start,
boolean ignoreCase)
s - the string to be inspectedc - the string to search forstart - the starting position for the searchignoreCase - if true case is ignored when comparing characters
public static java.lang.String overlayWith(java.lang.String s,
java.lang.String o,
int start)
s - the original stringo - the string to be overlayed over the original stringstart - the starting position for the overlay
public static java.lang.String overlayWith(java.lang.String s,
java.lang.String o,
int start,
char pad)
s - the original stringo - the string to be overlayed over the original stringstart - the starting position for the overlaypad - the padding character
public static java.lang.String remove(java.lang.String s,
int start,
int numChars)
s - the original stringstart - the starting positionnumChars - the number of characters to be removed
public static java.lang.String removeWords(java.lang.String s,
int startWord,
int numWords)
s - the input stringstartWord - the number of the first word to be removednumWords - the number of words to be removed.public static java.lang.String reverse(java.lang.String s)
s - the original stringjava.lang.stringBuffer#reverse()
public static java.lang.String rightJustify(java.lang.String s,
int len)
s - the input stringlen - the length of the new string
public static java.lang.String rightJustify(java.lang.String s,
int len,
char pad)
s - the input stringlen - the length of the new stringpad - the pad characterpublic static java.lang.String[] split(java.lang.String s)
java.lang.Character#isWhitespace(char) returns
true.
(Contributed by Eric Jablow)s - The string to split into its constituent words.
public static java.lang.String[] split(java.lang.String s,
int limit)
java.lang.Character#isWhitespace(char) returns
true.
(Contributed by Eric Jablow)s - The string to split into its constituent words.limit - The maximum number of words to return.
public static boolean startsWith(java.lang.String s,
java.lang.String prefix)
s - the input stringprefix - the prefixjava.lang.string#startsWith(String)
public static boolean startsWith(java.lang.String s,
java.lang.String prefix,
boolean ignoreCase)
s - the input stringprefix - the prefixignoreCase - if true case is ignored when comparing charactersjava.lang.string#startsWith(String),
java.lang.string#regionMatches(boolean, int, String, int, int)
public static boolean startsWith(java.lang.String s,
java.lang.String prefix,
int start)
s - the input stringprefix - the prefixstart - the starting position for the testjava.lang.string#startsWith(String, int)
public static boolean startsWith(java.lang.String s,
java.lang.String prefix,
int start,
boolean ignoreCase)
s - the input stringprefix - the prefixstart - the starting position for the testignoreCase - if true case is ignored when comparing charactersjava.lang.string#startsWith(String, int),
java.lang.string#regionMatches(boolean, int, String, int, int)
public static java.lang.String strip(java.lang.String s,
char c)
s - the string of which the character should be
stripped offc - the character to be stripped off
public static java.lang.String strip(java.lang.String s,
char c,
boolean ignoreCase)
s - the string of which the character should be
stripped offc - the character to be stripped offignoreCase - if true case is ignored when comparing characters
public static java.lang.String strip(java.lang.String s,
java.lang.String c)
s - the string of which characters should be
stripped offc - the characters to be stripped off
public static java.lang.String strip(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
s - the string of which characters should be
stripped offc - the characters to be stripped offignoreCase - if true case is ignored when comparing characterspublic static java.lang.String stripBlanks(java.lang.String s)
s - the string of which white space is to be stripped offjava.lang.Character#isWhitespace()
public static java.lang.String stripLeading(java.lang.String s,
char c)
s - the string of which the leading character should be
stripped offc - the character to be stripped off
public static java.lang.String stripLeading(java.lang.String s,
char c,
boolean ignoreCase)
s - the string of which the leading character should be
stripped offc - the character to be stripped offignoreCase - if true case is ignored when comparing characters
public static java.lang.String stripLeading(java.lang.String s,
java.lang.String c)
s - the string of which the leading characters should be
stripped offc - the characters to be stripped off
public static java.lang.String stripLeading(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
s - the string of which the leading characters should be
stripped offc - the characters to be stripped offignoreCase - if true case is ignored when comparing characterspublic static java.lang.String stripLeadingBlanks(java.lang.String s)
s - the string of which white space is to be stripped offjava.lang.Character#isWhitespace()
public static java.lang.String stripTrailing(java.lang.String s,
char c)
s - the string of which trailing characters should be
stripped offc - the character to be stripped off
public static java.lang.String stripTrailing(java.lang.String s,
char c,
boolean ignoreCase)
s - the string of which the trailing character should be
stripped offc - the character to be stripped offignoreCase - if true case is ignored when comparing characters
public static java.lang.String stripTrailing(java.lang.String s,
java.lang.String c)
s - the string of which trailing characters should be
stripped offc - the characters to be stripped off
public static java.lang.String stripTrailing(java.lang.String s,
java.lang.String c,
boolean ignoreCase)
s - the string of which trailing characters should be
stripped offc - the characters to be stripped offignoreCase - if true case is ignored when comparing characterspublic static java.lang.String stripTrailingBlanks(java.lang.String s)
s - the string of which white space is to be stripped offjava.lang.Character#isWhitespace()
public static java.lang.String substring(java.lang.String s,
int start)
s - the original stringstart - the starting positionStringIndexOutOfBoundsException - if
start is out of range.java.lang.string#substring(int)
public static java.lang.String substring(java.lang.String s,
int start,
int len)
s - the original stringstart - the starting positionlen - the length of the substringStringIndexOutOfBoundsException - if
start is out of range.java.lang.string#substring(int, int)
public static java.lang.String substring(java.lang.String s,
int start,
int len,
char pad)
s - the original stringstart - the starting positionlen - the length of the substringpad - the padding characterStringIndexOutOfBoundsException - if
start is out of range or len is
less than zero.java.lang.string#substring(int, int)
public static java.lang.String subWords(java.lang.String s,
int startWord,
int numWords)
s - the input stringstartWord - the word number of the first wordnumWords - the number of words to be returnedpublic static boolean toBoolean(java.lang.String s)
s - the input stringjava.lang.Boolean#valueOf(String).
public static byte toByte(java.lang.String s)
throws java.lang.NumberFormatException
s - the input stringjava.lang.NumberFormatException - if the string cannot be represented
as a byte.java.lang.Byte#valueOf(String).
public static byte toByte(java.lang.String s,
int radix)
throws java.lang.NumberFormatException
s - the input stringradix - the radix of the numberjava.lang.NumberFormatException - if the string cannot be represented
as a byte.java.lang.Byte#valueOf(String, int).
public static double toDouble(java.lang.String s)
throws java.lang.NumberFormatException
s - the input stringjava.lang.NumberFormatException - if the string cannot be represented
as a double.java.lang.Double#valueOf(String).
public static float toFloat(java.lang.String s)
throws java.lang.NumberFormatException
s - the input stringjava.lang.NumberFormatException - if the string cannot be represented
as a float.java.lang.Float#valueOf(String).
public static int toInt(java.lang.String s)
throws java.lang.NumberFormatException
s - the input stringjava.lang.NumberFormatException - if the string cannot be represented
as an int.java.lang.Integer#valueOf(String).
public static int toInt(java.lang.String s,
int radix)
throws java.lang.NumberFormatException
s - the input stringradix - the radix of the numberjava.lang.NumberFormatException - if the string cannot be represented
as an int.java.lang.Integer#valueOf(String, int).
public static long toLong(java.lang.String s)
throws java.lang.NumberFormatException
s - the input stringjava.lang.NumberFormatException - if the string cannot be represented
as a long.java.lang.Long#valueOf(String).
public static long toLong(java.lang.String s,
int radix)
throws java.lang.NumberFormatException
s - the input stringradix - the radix of the numberjava.lang.NumberFormatException - if the string cannot be represented
as a long.java.lang.Long#valueOf(String, int).public static java.lang.String toLowerCase(java.lang.String s)
s - the input stringjava.lang.string#toLowerCase()
public static java.lang.String toLowerCase(java.lang.String s,
java.util.Locale locale)
s - the input stringjava.lang.string#toLowerCase(Locale)
public static short toShort(java.lang.String s)
throws java.lang.NumberFormatException
s - the input stringjava.lang.NumberFormatException - if the string cannot be represented
as a short.java.lang.Short#valueOf(String, int).
public static short toShort(java.lang.String s,
int radix)
throws java.lang.NumberFormatException
s - the input stringradix - the radix of the numberjava.lang.NumberFormatException - if the string cannot be represented
as a short.java.lang.Short#valueOf(String).public static java.lang.String toTitleCase(java.lang.String s)
s - the input stringjava.lang.Character#toTitleCase(char)public static java.lang.String toUpperCase(java.lang.String s)
s - the input stringjava.lang.string#toUpperCase()
public static java.lang.String toUpperCase(java.lang.String s,
java.util.Locale locale)
s - the input stringjava.lang.string#toUpperCase(Locale)
public static java.lang.String translate(java.lang.String s,
java.lang.String setin,
java.lang.String setout)
s - the original stringsetin - the input set of characterssetout - the output set of characters
public static java.lang.String translate(java.lang.String s,
java.lang.String setin,
java.lang.String setout,
boolean ignoreCase)
s - the original stringsetin - the input set of characterssetout - the output set of charactersignoreCase - if true case is ignored when comparing characters
public static java.lang.String translate(java.lang.String s,
java.lang.String setin,
java.lang.String setout,
char pad)
s - the original stringsetin - the input set of characterssetout - the output set of characterspad - the pad character
public static java.lang.String translate(java.lang.String s,
java.lang.String setin,
java.lang.String setout,
char pad,
boolean ignoreCase)
s - the original stringsetin - the input set of characterssetout - the output set of characterspad - the pad characterignoreCase - if true case is ignored when comparing characters
public static java.lang.String word(java.lang.String s,
int wordNum)
s - the input stringwordNum - the number of the word to be returned
public static int wordIndexOfPhrase(java.lang.String s,
java.lang.String p,
int startWord)
s - the input stringp - the phrase to be searched forstartWord - the word number where the search is to start. The
first word has number 0.
public static int wordIndexOfPhrase(java.lang.String s,
java.lang.String p,
int startWord,
boolean ignoreCase)
s - the input stringp - the phrase to be searched forstartWord - the word number where the search is to start. The
first word has number 0.ignoreCase - if true case is ignored when comparing characters
public static java.lang.String wordSpace(java.lang.String s,
int spaces)
s - the input stringspaces - the number of blanks between the words
public static java.lang.String xRange(char start,
char end)
start - the starting characterend - the ending character
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||