Chapter 1

Working with Strings

IN THIS CHAPTER

check Quickly reviewing what you already know about strings

check Examining string class methods

check Working with substrings

check Splitting strings

check Using the StringBuilder and StringBuffer classes

check Using the CharSequence interface

Strings are among the most common types of objects in Java. Throughout this book are various techniques for working with strings. You’ve seen how to create string variables, how to concatenate strings, and how to compare strings. But so far, I’ve only scratched the surface of what you can do with strings. In this chapter, I dive deeper into what Java can do with strings.

I start with a brief review of what I’ve covered so far about strings, so that you don’t have to go flipping back through the book to find basic information. Then I look at the String class itself and some of the methods it provides for working with strings. Finally, ...

Get Java All-in-One For Dummies, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.