O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

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

The built-in types we’ve seen so far are all value types. System.String, however, is a reference type. To understand why this is the case, we first need to know about the memory layout and its implications (the subject of Chapter 9, “Introducing Types,” which covers the heap and the stack).

Note: System.String Versus the string Reserved Word

Don’t forget that the C# reserved words for built-in types are simply aliases for the underlying BCL types. In the case of C#’s string, that is System.String. Both can be used in source code, and when the System namespace is imported, the latter one can be abbreviated to String, with a capital S.

This casing doesn’t change the characteristics of the type. String is, and always is, a reference ...

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