| java.lang.Object edu.indiana.lib.twinpeaks.util.StringUtils
StringUtils | public class StringUtils (Code) | | |
capitalize | public static String capitalize(String text)(Code) | | Capitlize each word in a string (journal titles, etc)
Parameters: text - Text to inspect Capitalized text |
isNull | public static boolean isNull(String string)(Code) | | Null (or zero-length) String?
|
removeCharacterOrRangeAsCharacter | public static String removeCharacterOrRangeAsCharacter(String source, String pattern)(Code) | | Remove a character (or range of characters) from a string. If the
character is at the start or end of a word, remove the character only
(leave the word in place).
Parameters: source - String to edit Parameters: pattern - Character (or range) to remove. Range is a regularexpression: [\u002c-\u002f] or [,-/] Modified text |
removeCharacterOrRangeAsWord | public static String removeCharacterOrRangeAsWord(String source, String pattern)(Code) | | Remove a character (or range of characters) from a string. If the
character is in a word, remove the entire word.
Parameters: source - String to edit Parameters: pattern - Character (or range) to remove. Range is a regularexpression: [\u002c-\u002f] or [,-/] Modified text |
replace | public static String replace(String text, String targetText, String newText)(Code) | | Replace all occurances of the target text with the provided replacement
text. Both target and replacement may be regular expressions - see
java.util.regex.Matcher .
Parameters: text - Text to modify Parameters: targetText - Text to find and replace Parameters: newText - New text Updated text |
trimAll | public static String trimAll(String text, char character)(Code) | | Trim specified charcater from both ends of a String
Parameters: text - Text Parameters: character - Character to remove Trimmed text |
trimEnd | public static String trimEnd(String text, char character)(Code) | | Trim specified charcater from end of string
Parameters: text - Text Parameters: character - Character to remove Trimmed text |
trimFront | public static String trimFront(String text, char character)(Code) | | Trim specified charcater from front of string
Parameters: text - Text Parameters: character - Character to remove Trimmed text |
truncateAtWhitespace | public static String truncateAtWhitespace(String text, int length)(Code) | | Truncate text on a whitespace boundary (near a specified length).
The length of the resultant string will be in the range:
(requested-length * .25) ~ (requested-length * 1.5)
Parameters: text - Text to truncate Parameters: length - Target length Truncated text |
|
|