The Char Class |
![]() |
Str Library defines a helper class named Char. It implements the usual construction, assignment and comparision operations (that can just as easily be achieved using the C++ standard char or wchar_t types) as well as a few methods that insulate the programmer from having to call C RTL functions located in <ctype.h>
The Char class implements a typecasting operator to the STRCHAR type. This means that everywhere a function or method accepts a STRCHAR type, you can use a Char class instance and the compiler will automatically perform a conversion for you. There is zero performance penalty in Release builds for using Char instead of regular C character types.
The Char class can also seamlessly convert between ANSI and Unicode characters, no matter what is the mode in which you are compiling Str Library. Converting single characters through this class is faster than constructing one-character Str objects and performing the conversion using Str methods.
|
Important: When using Borland C++ Builder, the Char class is named StrChar to avoid a collision with a standard Borland VCL datatype |
See also: Char class methods, ANSI / Unicode mode, Unicode and UTF-8