|
Scribble Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cs101.util.StringUtils
cs101.util.StringUtils implements some string utility functions.
It is intended as a library class, i.e., all methods are static.
Copyright 1996 Massachusetts Institute of Technology
Field Summary | |
static java.lang.String |
nonWordChars
A string containing the non-word characters a user might reasonably be expected to type at a semi-standard American keyboard. |
Method Summary | |
static boolean |
allUpperCaseP(java.lang.String word)
Determines whether all of the characters in its argument word are upper case. |
static java.lang.String |
capitalize(java.lang.String word)
Constructs a new string identical to its argument, but with the first character replaced by its upper case equivalent. |
static java.lang.String |
capitalizeAll(java.lang.String word)
Constructs a new string identical to its argument, but with all characters replaced by their upper case equivalents. |
static boolean |
capitalizedP(java.lang.String word)
Determines whether the first character of its argument word is upper case. |
static int |
firstVowelPos(java.lang.String word)
Computes the index of the first position in String which contains a vowel (i.e., one of AEIOU). |
static java.lang.String |
unCapitalize(java.lang.String word)
Constructs a new string identical to its argument, but with the first character replaced by its lower case equivalent. |
static boolean |
wordP(java.lang.String word)
Determines whether its argument is a word or a delimiter as defined by a java.util.StringTokenizer when initialized with StringUtils.nonWordChars as a delimiter string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String nonWordChars
StringTokenizer
,
Constant Field ValuesMethod Detail |
public static final boolean wordP(java.lang.String word)
word
- String to be tested for "wordness".
StringTokenizer
,
nonWordChars
,
String
public static final boolean capitalizedP(java.lang.String word)
word
- String to be checked for capitalization.
Character.isUpperCase(char)
,
String.charAt(int)
public static final boolean allUpperCaseP(java.lang.String word)
word
- String to be checked for capitalization.
Character.isLowerCase(char)
,
String.charAt(int)
,
String.length()
public static final java.lang.String capitalize(java.lang.String word)
word
- String to be capitalized.
Character.toUpperCase(char)
,
StringBuffer
,
String.charAt(int)
,
String.valueOf(char)
public static final java.lang.String capitalizeAll(java.lang.String word)
word
- String to be uppercased.
Character.toUpperCase(char)
,
String.length()
,
String.charAt(int)
,
StringBuffer
public static final java.lang.String unCapitalize(java.lang.String word)
word
- String to be unCapitalized.
Character.toLowerCase(char)
,
String.length()
,
String.charAt(int)
,
String.valueOf(char)
public static final int firstVowelPos(java.lang.String word)
word
- String to be searched for vowel.
String.length()
,
String.charAt(int)
|
Scribble Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |