- 2018.1 (v1.0.4): Fix API() macro; Add new transform utils; Rename a few functions.
- 2018.1 (v1.0.3): Add
strnorm(),strjoin(). Fixstrcpyf(). - 2018.1 (v1.0.2): Add
stropt*()options parser. - 2018.1 (v1.0.1): Fix wrong version of strcatf() in first commit. Cosmetics.
- 2018.1 (v1.0.0): Initial release.
- Using Rob Pike's regular expression (apparently public domain).
- Using Sam Hocevar's preprocessor trick (apparently public domain).
- Using Bob Stout's transform utils (public domain).
- Using Sean Barrett and Jeff Roberts' string formatters (unlicensed).
- Using Werner Stoop's expression evaluator (unlicensed).
- Using Dimitri Diakopoulos' & Sean Barrett's unicode stuff (unlicensed).
- rlyeh, unlicensed (~public domain).
- Evaluates a mathematical expression. Returns number value, or NaN if error.
- Note: To check for NaN use
isnan(ret)orbool error = (ret != ret);
- Compares two strings. Returns string matching score (higher is better).
- Fuzzy search a word into a list of given words. Returns best match or empty string (if none).
- Regular expression matching. returns non-zero if found.
cmatches any literal character c.?matches any single character.^matches the beginning of the input string.$matches the end of the input string.*matches zero or more occurrences of the previous character.
- Return true if string matches wildcard pattern expression (?*).
- Runtime string hash. Returns 64-bit hash of given string.
- Compile-time string hash macro. Returns 64-bit hash of given string.
- Note: Macro requires code optimizations enabled (
-O3for gcc,/O2for MSVC).
- Insert string into dictionary (if not exists). Returns quark ID, or 0 if empty string.
- Retrieve previously interned string. ID#0 returns empty string always.
- Extract substring from position. Negative positions are relative to end of string.
- Search substring from beginning (left). Returns end-of-string if not found.
- Search substring from end (right). Returns end-of-string if not found.
- Return true if string starts with substring.
- Return true if string ends with substring.
- Return true if strings are equal.
- Return true if strings are equal (case insensitive).
- Normalize resource identificator. Normalized uris have deterministic string hashes.
- Convert a string to integer.
- Convert number to human readable string (
12000000 -> 12M) - Convert human readable string to number (
12M -> 12000000)
- Parse argc/argv looking for comma-separated values. Returns matching string or
defaults. - Parse argc/argv looking for comma-separated values. Returns matching integer or
defaults. - Parse argc/argv looking for comma-separated values. Returns matching floating or
defaults.
- Format a C-style formatted string. Returns temporary buffer (do not
free()). - Format a C-style formatted valist. Returns temporary buffer (do not
free()). - Note: 16 buffers are handled internally so that nested calls are safe within reasonable limits.
- Assign a C-style formatted string. Reallocates input buffer (will create buffer if
stris NULL). - Assign a C-style formatted valist. Reallocates input buffer (will create buffer if
stris NULL). - Concat a C-style formatted string. Reallocates input buffer (will create buffer if
stris NULL). - Concat a C-style formatted valist. Reallocates input buffer (will create buffer if
stris NULL).
- Check delimiters and split string into tokens. Function never allocates.
- Check delimiters and split string into tokens. Returns null-terminated list.
- Join tokens into a string.
- Delete substring from a string.
- Trim characters from begin of string to first-find (
b-str-str-etox-xxx-str-e). - Trim characters from begin of string to last-find (
b-str-str-etox-xxx-xxx-e). - Trim characters from first-find to end of string (
b-str-str-etob-xxx-xxx-x). - Trim characters from last-find to end of string (
b-str-str-etob-str-xxx-x). - Trim leading, trailing and excess embedded whitespaces.
- Replace a substring in a string.
- Remap specific characters in a string from a given set to another one. Length of both sets must be identical.
- Convert a string to lowercase (ANSI only, not utf8/locale aware!).
- Convert a string to uppercase (ANSI only, not utf8/locale aware!).
- Reverse a string in-place.
- Extract 32bit codepoint from string. Also advances input string to next codepoint.
- Convert 32bit codepoint to utf8 string.
- Convert utf8 to utf16 string.
- Convert utf16 to utf8 string.