Strings
Last updated
Last updated
String
is a collection of Characters represented in Java.
Characters
is a primitive datatype in Java that represents single characters trapped within single quotation marks.
String
is a built-in class in Java where we can create String
objects. Objects will also have methods which provides access to String
class features.
Indexing a String is a concept of getting a singular character from the String. Always remember that indexing starts at 0
.
Since we can access individual characters by accessing the index, it is often nice to know the length/size of a String.
When you don't know the index of a character or a certain pattern within the String, you can use a indexOf()
method to find the index.
You can convert a String
to have all its characters be either lowercase or uppercase.