String Methods Flashcards
Returns the character of a string based on the specified index.
charAt
Compares a string with another string.
compareTo
Returns a new string concatenated with the value of the parameter
concat
Returns true if this string and the specified string are equal.
equals
Returns true if this string and the specified string are equal, considering the uppercase and lowercase versions of a letter to be the same.
equalIgnoreCase
Returns the index of the first occurrence of the specified within this string.
indexOf
Returns the index of the last occurrence of the specified within this string.
lastIndexOf
Returns the length of the string in int type.
length
Returns a new string having the same characters as this string, but with any uppercase letters converted to lowercase.
toLowerCase
Returns a new string having the same characters as this string, but with any lowercase letters converted to uppercase.
toUpperCase
Returns a new string having the same characters as this string, but with each occurrence of specified old_char replaced by new_char.
replace
Returns a new string having the same characters as the substring begins at specified start index through the end of the string.
substring(start_index)
Returns anew string having the same characters as the substring that begins at specified index start through to but not including the character at index end.
substring(start, end)
Returns a new string having the same characters as this string, but with leading and trailing whitespace removed.
trim