Java String Flashcards
It contains a collection of Unicode Characters surrounded by double quotes
String
Used for storing text
String
The length of a string can be found with the Length
property.
String length
Syntax of string length
identifier.length()
Returns the uppercase equivalent of the argument; no change is made if the argument is not a lowercase letter.
String toUpperCase
Syntax of String toUpperCase
identifier.toUpperCase()
Returns the lowercase equivalent of the argument; no change is made if the argument is not an uppercase letter.
String toLowerCase
Method of combining two strings or more than string at once
StringConcatenation
You can access the characters in a string by referring to its index number
inside.
String charAt
Syntax of String charAt
identifier.charAt(index number)
You can also find the index position of a specific character in a string, by using the indexOf() method
String indexOf
It extracts the characters from a string, starting from the specified
character position/ index and returns a new string.
String substring()
Syntax of String substring()
identifier.substring(index)
Contains standard methods for testing the values of characters
Character class
Returns true if the arguement is a digit (0-9) and false otherwise
Character.isDigit()