Java String ClassReview the String class. Declare, concatenate and manipulate strings.
String. Deep in the cave you encounter a pool. You discover a message written upon the water's surface. It is a string with letters and words.
The internal data, the characters, of a String can be thought of as an array. And with built-in methods, we can convert Strings into, and from, different types of arrays.Byte Array, StringChar Array, String
Uppercase first letter.
With toUpperCase we change all letters in a String. But often we want to modify just the first letter, or the first letter of individual words.Uppercase First Letter
Java is full of old things we should not use. StringTokenizer is one example. Its functionality is easily replaced with split() but it exists for backwards compatibility.StringTokenizer
Strings cannot be easily manipulated in their initial form. Instead we transform them to a char array. In this way we can even reverse them.Reverse String
A final note. A String can represent any data. But textual representation is rarely the most efficient form. Directly storing numbers as ints is faster.
© 2007-2020 Sam Allen. Every person is special and unique. Send bug reports to email@example.com.