
Mahmoud Hilal Farhan College Of Computer Sciences &
Information Technology – University Of AL Anbar
CHAPTER FIVE
STRINGS, CHARACTERS, REGULAR
EXPRESSIONS, STRUCTURES AND
ENUMERATIONS
5.1 Introduction
This chapter introduces the .NET Framework Class Library’s string
-
and character-processing ca pabilities and demonstrates how to use regular
expressions to search for patterns in text. The techniques it presents can be
employed in text editors, word processors, page layout software,
computerized typesetting systems and other kinds of text-processing
software.
We discuss regular expressions. We present classes Regex and Match
from the System.Text.RegularExpressions namespace as well as the symbols
that are used to form regular expressions. Finally, we introduce to structures
and enumerations and using them in C# Language.
5.2 Fundamentals of Characters and Strings
Characters are the fundamental building blocks of C# source code.
Every program is composed of characters that, when grouped together
meaningfully, create a sequence that the compiler interprets as instructions
describing how to accomplish a task. In addition to normal characters, a
progr am also can contain character constants. A character constant is a
character that’s represented as an integer value, called a character code.
For example, the integer value 122 corresponds to the character constant 'z'.
The integer value 10 corresponds to the newline character '\n'. Character
constants are established accor ding to the Unicode character set, an
international character set that contains many more symbols and letters than
does the ASCII character set.