String Methods
Let's take a deeper look at the methods that belong to the String class.
StartKey Concepts
Review core concepts you need to learn to master this subject
length() String Method in Java
concat() String Method in Java
String Method equals() in Java
indexOf() String Method in Java
charAt() String Method in Java
toUpperCase() and toLowerCase() String Methods
length() String Method in Java
length() String Method in Java
String str = "Codecademy";
System.out.println(str.length());
// prints 10
In Java, the length()
string method returns the total number of characters – the length – of a String
.
String Methods
Lesson 1 of 1
- 1As you may recall, a String, which is widely used in Java, is an object that represents a sequence of characters. It is a great way to store information. Because character strings are so vital to…
- 7There may be times when we only want a part of a string. In such cases, we may want to extract a substring from a string. The substring() method does exactly that. For example: String line = “…
- 8There will be times when we have a word in a case other than what we need it in. Luckily, Java has a couple String methods to help us out: - toUpperCase(): returns the string value converted to up…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory