Chapter 25. Other Topics


In this chapter, I'll cover a number of other topics that are important in using C#, but that don't fit neatly into one of the other chapters. These include string handling, nullable types, the Main method, documentation comments, and nested types.


0s and 1s are fine for internal computation, but for human-readable input and output, we need strings of characters. The BCL provides a number of classes that make string handling easy.

The C# predefined type string represents the .NET class System.String. The most important things to know about strings are the following:

  • Strings are arrays of Unicode characters.

  • Strings are immutable—they cannot be changed.

The string type has many useful string-manipulation members, ...

Get Illustrated C# 2008 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.