vibe.utils.string

Utility functions for string processing

Public Imports

std.string
public import std.string;
Undocumented in source.

Members

Aliases

countUntilAny
alias countUntilAny = indexOfAny
Undocumented in source.

Functions

allOf
bool allOf(const(char)[] str, const(char)[] chars)

Checks if all characters in 'str' are contained in 'chars'.

anyOf
bool anyOf(const(char)[] str, const(char)[] chars)

Checks if any character in 'str' is contained in 'chars'.

formatAlloc
string formatAlloc(IAllocator alloc, string fmt, ARGS args)

Same as std.string.format, just using an allocator.

icmp2
int icmp2(const(char)[] a, const(char)[] b)

Special version of icmp() with optimization for ASCII characters

indexOfAny
sizediff_t indexOfAny(const(char)[] str, const(char)[] chars)

Finds the first occurence of any of the characters in chars

matchBracket
sizediff_t matchBracket(const(char)[] str, bool nested)

Finds the closing bracket (works with any of '[', '(', '<', '{').

sanitizeUTF8
string sanitizeUTF8(ubyte[] str)

Takes a string with possibly invalid UTF8 sequences and outputs a valid UTF8 string as near to the original as possible.

stripA
inout(char)[] stripA(inout(char)[] s)

ASCII whitespace trimming (space and tab)

stripLeftA
inout(char)[] stripLeftA(inout(char)[] s)

ASCII whitespace trimming (space and tab)

stripRightA
inout(char)[] stripRightA(inout(char)[] s)

ASCII whitespace trimming (space and tab)

stripUTF8Bom
inout(char)[] stripUTF8Bom(inout(char)[] str)

Strips the byte order mark of an UTF8 encoded string. This is useful when the string is coming from a file.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig