14 What’s “new”: The StringParser Class
One of the themes of this book is that there’s nothing magic about classes and object-oriented programming. Contrary to what some books may tell you, a class is not useful just because it’s a class—any more than a tool consisting of random pieces of metal stuck together is useful. A class becomes useful when it provides a set of related services that solve common programming problems.
One of the most common tasks in programming is to get input and analyze it. This chapter features a class—the StringParser class—that breaks an input string into a series of substrings, each containing a word.
Most of the ...