Strings
String
is a collection of Characters represented in Java.
Characters
is a primitive datatype in Java that represents single ASCII 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
Indexing a String is a concept of getting a singular character from the String. Always remember that indexing starts at 0
.
Size of a String
Since we can access individual characters by accessing the index, it is often nice to know the length/size of a String.
Finding a Character or a Pattern
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.
Lowercase and Uppercase String
You can convert a String
to have all its characters be either lowercase or uppercase.
Last updated