Chapter 25. Other Topics

Overview

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.

Strings

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.