String/character Methods Flashcards
compareTo(String)
Compares to strings lexicographically by returning a negative #, positive # or zero
RETURN TYPE int
equals(Object)
Compares this string to the specified object
RETURN TYPE int
charAt(int)
Returns the CHAR value at the specified index
RETURN TYPE char
indexOf(String)
Returns the index within this string of the first occurrence of the specified substring
RETURN TYPE int
indexOf(String, int)
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index
RETURN TYPE int
length( )
Returns the number of characters in this string
RETURN TYPE int
substring(int)
Returns a new string that is a substring of this string
RETURN TYPE String
substring(int, int)
Returns a substring between the specified offsets of the current string
RETURN TYPE String
toLowerCase( )
Converts the entire string to lowercase
RETURN TYPE String
toString( )
This object (which is already a string!) is itself returned RETURN TYPE String
toUpperCase( )
Converts the entire string to uppercase
RETURN TYPE String
valueOf(double)
valueOf(float)
…(int)
…(Object)
Returns the string representation of the (double, float, int, Object) argument
RETURN TYPE static String
compareTo(Character)
Compares two Character objects numerically
RETURN TYPE int
isLetter(char)
Determines if the specified character is a letter
RETURN TYPE static boolean