Strings Flashcards
What is the a string terminated by?
Null Character.
What does length() do?
Used to return the length of a string.
What does toLowerCase() do?
Used to return string in lowercase.
What does toUpperCase() do?
Used to return string in uppercase.
What does contains() do?
Used to check the existence of another string.
What does endsWith() do?
Used to check if a string ends with a specific character.
What does index() do?
Used to check the index of a character in a string.
What does replace() do?
Used to replace a character in the original string.
What does substring() do?
Used to return a substring of the original string.
What does compareTo() do?
Compares an instance with a specified string and checks whether it follows in the same sort order as the specified string.
Explain the possible values of compareTo()?
Value is less than 0: Precedes order.
Value is greater than 0: Follows order.
Value is equal to 0: Equal in order.