vutil.string

Utility functions for string processing

Public Imports

std.string
public import std.string;

Members

Aliases

countUntilAny
alias countUntilAny = indexOfAny
Undocumented in source.

Functions

allOf
bool allOf(string str, string chars)

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

anyOf
bool anyOf(string str, string chars)

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

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

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

icmp2
int icmp2(string a, string b)

Special version of icmp() with optimization for ASCII characters

indexOfAny
sizediff_t indexOfAny(string str, string chars)

Finds the first occurence of any of the characters in chars

indexOfCT
ptrdiff_t indexOfCT(Char[] s, dchar c, CaseSensitive cs)
Undocumented in source. Be warned that the author may not have intended to support it.
matchBracket
sizediff_t matchBracket(string 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
string stripA(string s)

ASCII whitespace trimming (space and tab)

stripLeftA
string stripLeftA(string s)

ASCII whitespace trimming (space and tab)

stripRightA
string stripRightA(string s)

ASCII whitespace trimming (space and tab)

stripUTF8Bom
string stripUTF8Bom(string 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