|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ix.util.Strings
A class containing useful static string methods.
Method Summary | |
static java.lang.String |
afterLast(java.lang.String separator,
java.lang.String s)
Returns the substring starting directly after the last occurrence of the separator. |
static java.lang.String |
beforeFirst(java.lang.String separator,
java.lang.String s)
Returns the substring that ends directly before the first occurrence of the separator. |
static java.util.List |
breakAt(java.lang.String separator,
java.lang.String s)
Returns a list of the substrings delimited by the given separator. |
static java.lang.String[] |
breakAtFirst(java.lang.String separator,
java.lang.String s)
breakAtFirst takes a string containing fields separated by a (string) delimiter and returns a two-element string array containing the substring before the first occurrence of the char and the substring after. |
static java.util.List |
breakIntoLines(java.lang.String text)
Returns a List of the lines in a string. |
static java.lang.String |
capitalize(java.lang.String s)
Returns a copy of the string in which the first character is in upper case and the rest of the string is left as it was. |
static java.lang.String |
dashNameToJavaName(java.lang.String name)
Converts a name in which words are separate by dashes into one that uses Java-style capitalisation instead. |
static java.lang.String |
firstLine(java.lang.String s)
Returns the first line of a string. |
static java.lang.String |
foldLongLine(java.lang.String text)
Replaces some spaces with line separators to make a long string more readable in contexts where it would have been displayed as a single line. |
static int |
indexOfAny(java.lang.String chars,
int start,
java.lang.String s)
Returns the index of the first occurrence of any of the specified characters, or -1 if none are found. |
static int |
indexOfAny(java.lang.String chars,
java.lang.String s)
Returns the index of the first occurrence of any of the specified characters, or -1 if none are found. |
static java.lang.String |
javaNameToDashName(java.lang.String name)
Converts a name that shows word boundaries using Java-style capitalization to a name in which words are all lower case and separated by dashes. |
static java.lang.String |
quote(java.lang.String text)
Puts double quotes around a string. |
static java.lang.String |
repeat(int count,
java.lang.String s)
Returns a String made by appending a specified string count times. |
static java.lang.String |
replace(java.lang.String from,
java.lang.String to,
java.lang.String source)
Returns a string formed by replacing every occurrence of from with to in source. |
static java.lang.String |
uncapitalize(java.lang.String s)
Returns a copy of the string in which the first character is in lower case and the rest of the string is left as it was. |
Methods inherited from class java.lang.Object |
|
Method Detail |
public static int indexOfAny(java.lang.String chars, java.lang.String s)
chars
- the characters to look fors
- the string to look inpublic static int indexOfAny(java.lang.String chars, int start, java.lang.String s)
chars
- the characters to look forstart
- index to start lookings
- the string to look inpublic static java.lang.String[] breakAtFirst(java.lang.String separator, java.lang.String s)
separator
- the delimiters
- the string that may contain itpublic static java.util.List breakAt(java.lang.String separator, java.lang.String s)
separator
- the delimiters
- the string that may contain itpublic static java.lang.String beforeFirst(java.lang.String separator, java.lang.String s)
separator
- the delimiters
- the string that may contain itpublic static java.lang.String afterLast(java.lang.String separator, java.lang.String s)
separator
- the delimiters
- the string that may contain itpublic static java.lang.String firstLine(java.lang.String s)
public static java.util.List breakIntoLines(java.lang.String text)
public static java.lang.String foldLongLine(java.lang.String text)
public static java.lang.String replace(java.lang.String from, java.lang.String to, java.lang.String source)
from
- the text to replaceto
- the text to replace it withsource
- the text in which to do the replacingpublic static java.lang.String quote(java.lang.String text)
public static java.lang.String capitalize(java.lang.String s)
public static java.lang.String uncapitalize(java.lang.String s)
public static java.lang.String repeat(int count, java.lang.String s)
public static java.lang.String dashNameToJavaName(java.lang.String name)
public static java.lang.String javaNameToDashName(java.lang.String name)
JavaNameWordIterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |