In this chapter, I’ll explain the mechanics of working with individual characters and strings in the Microsoft .NET Framework. I’ll start by talking about the
System.Char structure and the various ways that you can manipulate a character. Then I’ll go over the more useful
System.String class, which allows you to work with immutable strings. (Once created, immutable strings can’t be modified in any way.) After examining strings, I’ll show you how to perform various operations efficiently to build a string dynamically via the
System.Text.StringBuilder class. With the string basics out of the way, I’ll then describe how to format objects into strings and how to efficiently persist or transmit strings using various encodings. ...