Chapter 16. Strings, Characters and Regular Expressions


The chief defect of Henry King Was chewing little bits of string.

Hilaire Belloc

Vigorous writing is concise. A sentence should contain no unnecessary words, a paragraph no unnecessary sentences.

William Strunk, Jr.

I have made this letter longer than usual, because I lack the time to make it short.

Blaise Pascal

The difference between the almost-right word and the right word is really a large matterit's the difference between the lightning bug and the lightning.

Mark Twani

Mum's the word.

Miguel de Cervantes

Objectives

In this chapter you will learn:

  • To create and manipulate immutable character String objects of class String.

  • To create and manipulate mutable character String objects of class StringBuilder.

  • To manipulate character objects of structure Char.

  • To use regular expressions in conjunction with classes Regex and Match.

Outline

16.1 Introduction

16.2 Fundamentals of Characters and Strings

16.3 String Constructors

16.4 String Indexer, Length Property and CopyTo Method

16.5 Comparing Strings

16.6 Locating Characters and Substrings in Strings

16.7 Extracting Substrings from Strings

16.8 Concatenating Strings

16.9 Miscellaneous String Methods

16.10 Class StringBuilder

16.11 Length and Capacity Properties, EnsureCapacity Method and Indexer of Class StringBuilder

16.12 Append and AppendFormat Methods of Class StringBuilder

16.13 Insert, Remove and Replace Methods of Class StringBuilder

16.14 Char Methods

16.15 Card Shuffling and Dealing Simulation

16.16 Regular Expressions and Class Regex

16.16.1 Regular Expression Example

16.16.2 Validating User Input with Regular Expressions

16.16.3 Regex methods Replace and Split

16.17 Wrap-Up



Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net