vibe.d beta banner
get vibe.d
0.10.0

Asynchronous I/O that doesn’t get in your way, written in D

Module vibe.utils.string

Utility functions for string processing

Functions

NameDescription
allOf(str, chars) Checks if all characters in 'str' are contained in 'chars'.
anyOf(str, chars) Checks if any character in 'str' is contained in 'chars'.
formatAlloc(alloc, fmt, args) Same as std.string.format, just using an allocator.
icmp2(a, b) Special version of icmp() with optimization for ASCII characters
indexOfAny(str, chars) Finds the first occurence of any of the characters in chars
indexOfCT(s, c, cs)
indexOfCT(s, needle)
matchBracket(str, nested) Finds the closing bracket (works with any of '[', '(', '<', '{').
sanitizeUTF8(str) Takes a string with possibly invalid UTF8 sequences and outputs a valid UTF8 string as near to the original as possible.
stripA(s) ASCII whitespace trimming (space and tab)
stripLeftA(s) ASCII whitespace trimming (space and tab)
stripRightA(s) ASCII whitespace trimming (space and tab)
stripUTF8Bom(str) Strips the byte order mark of an UTF8 encoded string. This is useful when the string is coming from a file.

Aliases

NameTypeDescription
countUntilAny
Authors

Sönke Ludwig

Copyright

© 2012-2014 Sönke Ludwig

License

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