O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The string type

Single characters are not much fun on their own but, when put together, they constitute a powerful communication tool. The string type does exactly this for us, providing a powerful means of representing and working with strings of characters. strings are consequently used in most of your programs for names, descriptions, addresses, headings, and so on.

The word string is an alias for the .NET Framework class String located in the System namespace. Whenever you declare a variable to be of type string, you are, in fact, specifying this variable to be able to hold a reference to a System.String object, which then encapsulates your text. Consequently, the following two lines of source code have exactly the same meaning.

The string ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required