dmd.root.string

Contains various string related functions.

Members

Functions

dstrcmp
int dstrcmp(scope const char[] s1, scope const char[] s2)

A string comparison functions that returns the same result as strcmp

startsWith
bool startsWith(scope const(char)* p, scope const(char)[] needle)

Checks if C string p starts with needle.

stripLeadingLineTerminator
string stripLeadingLineTerminator(string str)

Strips one leading line terminator of the given string.

toCStringThen
auto toCStringThen(const(char)[] src)

Copy the content of src into a C-string ('\0' terminated) then call dg

toDString
inout(char)[] toDString(inout(char)* s)

Slices a \0-terminated C-string, excluding the terminator

toStaticArray
char[N + 1] toStaticArray(scope const(char)[N] literal)

Infers the length N of a string literal and coerces its type to a static array with length N + 1. Returns the string with a null character appended to the end.

Static functions

iequals
bool iequals(const(char)[] s1, const(char)[] s2)

Compare two slices for equality, in a case-insensitive way

Meta