-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Learn Java 17 Programming - Second Edition
By :

In mainstream programming, String
probably is the most popular class. In Chapter 1, Getting Started with Java 17, we learned about this class, its literals, and its specific feature called string immutability. In this section, we will explain how a string can be processed using the String
class methods and utility classes from the standard library, and the StringUtils
class from the org.apache.commons.lang3
package in particular.
The String
class has more than 70 methods that enable analyzing, modifying, and comparing strings, and converting numeric literals into the corresponding string literals. To see all the methods of the String
class, please refer to the Java API online at https://docs.oracle.com/en/java/javase.
The length()
method returns the number of characters in the string, as shown in the following code:
String s7 = "42";
System.out.println(s7.length()); //prints...
Change the font size
Change margin width
Change background colour