O'Reilly logo

Start Here!™ Fundamentals of Microsoft® .NET Programming by Rod Stephens

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

Strings

Different programming languages handle strings in very different ways. In some languages such as C++, a string is a null-terminated series of characters. In other words, it’s a byte array with each byte holding the code for a single character plus a final byte holding the value 0 to mark the end of the string.

In the .NET languages Visual Basic and C#, a string is more complicated. In those languages, a string includes some header information describing the string, plus a reference pointing to a buffer that holds the actual null-terminated string somewhere else in memory.

The characters in a string are stored as Unicode, a system that uses 2 bytes to represent each character. Only 1 byte is necessary to store the characters on a standard ...

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