\u2022 To be able to use aSt ri ngT ok en iz er object to break aS tri ng object into individual components called tokens.
In this chapter, we introduce Java\u2019s string and character-processing capabilities. The tech- niques discussed here are appropriate for validating program input, displaying information to users and other text-based manipulations. The techniques also are appropriate for devel- oping text editors, word processors, page-layout software, computerized typesetting sys- tems and other kinds of text-processing software. We have already presented several string- processing capabilities in the text. This chapter discusses in detail the capabilities of class
10.12String Methodi nt e rn
10.15StringBuffer Methodsl e ng t h,c a pa ci t y,s e tL e ng t h and
10.17StringBuffer append Methods
10.18StringBuffer Insertion and Deletion Methods
10.19Character Class Examples
Summary\u2022 Terminology\u2022 Self-Review Exercises\u2022 Answers to Self-Review Exercises\u2022 Exercises\u2022 Special Section: Advanced String Manipulation Exercises\u2022 Special Section: Challenging String Manipulation Projects
Characters are the fundamental building blocks of Java source programs. Every program is composed of a sequence of characters that\u2014when grouped together meaningfully\u2014is in- terpreted by the computer as a series of instructions used to accomplish a task. A program might contain character constants. A character constant is an integer value represented as a character in single quotes. As we stated previously, the value of a character constant is the integer value of the character in the Unicode character set. For example,' z ' repre- sents the integer value ofz, and'\ n ' represents the integer value of newline. See Appen- dix D for the integer equivalents of these characters.
A string is a series of characters treated as a single unit. A string may include letters, digits and various special characters, such as+,-,*,/,$ and others. A string is an object of classS t ri n g. String literals or string constants (often calledanon ym ousS tr i ng
ClassSt r in g provides nine constructors for initializingS tr i ng objects in a variety of ways. Seven of the constructors are demonstrated in Fig. 10.1. All the constructors are used in theSt r in g Co n st r uc to r s application\u2019sm a in method.
Now bringing you back...
Does that email address look wrong? Try again with a different email.
This action might not be possible to undo. Are you sure you want to continue?