In environments such as C++ and C, the string is not a built-in type at all but, rather, a
more primitive, raw construct, such as a pointer to the first character in an array of characters.
Typically, string-manipulation routines are not part of the language but rather a part of a library
used with the language. Although that is mostly true with Visual Basic (VB), the lines are somewhat
blurred by the .NET runtime. The designers of the Common Language Infrastructure (CLI)
specification could have chosen to represent all strings as simple arrays of System.Char types,
but instead they chose to annex System.String into the collection of built-in types. In fact,
System.String is an oddball in the built-in type collection, since it is a reference type, and most
of the built-in types are value types. However, it??™s not always easy to see this difference because
the String type behaves with value semantics.
You may already know that the System.String type represents a Unicode character string,
and System.Char represents a 16-bit Unicode character. Of course, this makes portability and
localization to other operating systems??”especially systems with large character sets??”easy.
However, sometimes you might need to interface with external systems using encodings other
167
C H A P T E R 9
than Unicode character strings.
Pages:
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283