fast.string

Fast, non-allocating string functions.

Members

Functions

equalLength
size_t equalLength(inout(char[]) a, inout(char[]) b)
Undocumented in source. Be warned that the author may not have intended to support it.
find
size_t find(char[] str)

Finds the first occurrence of a set of compile-time known code units in a string. While the algorithm is O(n) in relation to the count of given code units, the overhead when using it on short strings weights more for only 1 or 2 code units.

find
inout(char)* find(inout(char*) ptr)

Same as the overload for strings, but with only a char*, making it faster as it cannot do a boundary check.

keyword1
bool keyword1(char[] str, bool function(ref immutable(char)* key, ref const(char)* str) mismatcher)
Undocumented in source. Be warned that the author may not have intended to support it.
keyword2
bool keyword2(char[] str, bool function(ref immutable(char)* key, ref const(char)* str) mismatcher)
Undocumented in source. Be warned that the author may not have intended to support it.
keyword3
bool keyword3(char[] str, bool function(ref immutable(char)*, ref const(char)*) mismatcher)
Undocumented in source. Be warned that the author may not have intended to support it.
split
bool split(inout(char[]) str, inout(char)[] before, inout(char)[] after, char* splitter)

Splits a string in two around one or more compile-time known code units.

split
char split(inout(char*) ptr, inout(char)[] before, inout(char)* after)

Similar to the overload for strings, this function works a little faster as it lacks boundary checks. It assumes that one of the characters in match is actually contained in the string.

Templates

concat
template concat(Strs...)

Concatenates a series of strings.

Meta