Strings
In C3, multiple string types are available, each suited to different use cases.
String¶
Strings are usually the typical type to use, they can be sliced, compared etc ... It is possible to access the length of aStringinstance through the.lenoperator.
ZString¶
ZStringis used when working with C code, which expects null-terminated C-style strings of typechar*. It is atypedefso converting to aZStringrequires an explicit cast. This helps to remind the user to check there is appropriate\0termination of the string data.
Caution
Ensure the terminal \0 when converting from String to ZString.
WString¶
- The
WStringtype is similar toZStringbut usesChar16*, typically for UTF-16 encoded strings. This type is useful for applications where 16-bit character encoding is required.
DString¶
DStringis a dynamic string builder that supports various string operations at runtime, allowing for flexible manipulation without the need for manual memory allocation.