Simple (ASCII-only) text-processing functions, for speed and CTFE.
ae.utils.text.html
Pure D code to parse floating-point values. Adapted to nothrow/@nogc from std.conv.
Case-insensitive ASCII string.
Case-insensitive Unicode string.
C format string to exactly format a floating-point type T.
Format string for a FP type which includes all necessary significant digits
How many significant decimal digits does a FP type have (determined empirically - valid for all D FP types on x86/64)
Undo rawToUTF8.
Parses hex into an array of bytes. hex.length should be even.
Parses hex into the given array buf.
Like readText, but with in-memory data. Reverse of ae.utils.array.bytes (for strings).
Like std.string.split (one argument version, which splits by whitespace), but only splits by ASCII and does not autodecode.
Like strip, but only removes ASCII whitespace.
Join an array of words into a camel-cased string.
Ditto, for substrings
Consume a LF or CRLF terminated line from s. Sets s to null and returns the remainder if there is no line terminator in s.
An implementation of replace optimized for common cases (short strings).
An implementation of split optimized for common cases. Allocates only once.
Select best match from a list of items. Returns -1 if none are above the threshold.
Lossily convert arbitrary data into a valid UTF-8 string.
UFCS helper
Lazily formatted object
Parses s as a hexadecimal number into an integer of type T.
Return the slice up to the first NUL character, or of the whole array if none is found.
Formats binary data as a hex dump (three-column layout consisting of hex offset, byte values in hex, and printable low-ASCII characters).
Replaces runs of ASCII whitespace which contain a newline ('\n') into a single space.
Replaces all runs of ASCII whitespace with a single space.
Where a delegate with this signature is required.
Get shortest string representation of a numeric type that still converts to exactly the same number.
Parse a single hexadecimal digit according to the policy in config.
Like fpToString, but writes the result to a sink.
Generate a random string with the given parameters. std.random is used as the source of randomness. Not cryptographically secure.
Convert any data to a valid UTF-8 bytestream, so D's string functions can properly work on it.
Parses hex into the given array buf. Fast version for static arrays of known length.
Covering slice-list of s with interleaved whitespace.
Select best match from a list of items. Returns null if none are above the threshold.
Like splitLines, but does not attempt to split on Unicode line endings. Only splits on "\r", "\n", and "\r\n".
Splits out words from a camel-cased string. All-uppercase words are returned as a single word.
Simpler implementation of Levenshtein string distance
Return a number between 0.0 and 1.0 indicating how similar two strings are (1.0 if identical)
Conversion an integer type to a fixed-length hexadecimal string.
Like std.string.wrap, but preserves whitespace at line start and between (non-wrapped) words.
Wraps the result of fpToString in a non-allocating stringifiable struct.
Policy for parseHexDigit.
Get shortest string representation of a FP type that still converts to exactly the same number.
Conversion from bytes to hexadecimal strings.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Utility code related to string and text processing.