Struct String

GC-free UTF-8 string type based on DynamicArray. Stores up to 128 bytes without dynamic memory allocation, so short strings are processed very fast. String is always zero-terminated and directly compatible with C.

struct String ;

Constructors

NameDescription
this (s) Construct from D string
this (wStr) Construct from zero-terminated UTF-16 LE string
this (cStr) Construct from zero-terminated C string (ASCII or UTF8)
this (istrm) Construct from an InputStream

Fields

NameTypeDescription
data DynamicArray!(char,128L)Underlying array of characters

Methods

NameDescription
decode () Range interface that iterates the string by Unicode code point (dchar), i.e., foreach(dchar c; str.byDChar)