The string
module automatically imports the err
module.
All the functions are designed to work for the strings in the default encoding. If passed a string in an encoding that has a different null terminator, then the results are undefined and the program will most likely crash or freeze.
Calculates the length of a null-terminated string.
If the string is longer than 255 bytes, then the behaviour is undefined (might even crash).
Compares two null-terminated strings. Returns 0 if equal, non-0 if not equal. If any of the strings is longer than 255 bytes, then the behaviour is undefined (might even crash).
Copies the source null-terminated string into the destination buffer, including the string terminator. If the source string is longer than 255 bytes, then the behaviour is undefined (might even crash).
Copies the source null-terminated string into the destination buffer, excluding the string terminator. If the source string is longer than 255 bytes, then the behaviour is undefined (might even crash).
Converts a null-terminated string to a number.
Sets errno
.
Modifies the given null-terminated buffer by appending a null-terminated string or a single character respectively.
The scrstring
module automatically imports the string
and err
modules.
It contains functions for handling strings in the screen encoding with the same semantics as the functions from the string module.
The pstring
module automatically imports the err
module.
It contains functions for handling length-prefixed strings in any 8-bit encoding.
Converts a length-prefixed string to a number. Uses the default encoding.
Sets errno
.
Converts a length-prefixed string to a number. Uses the screen encoding.
Sets errno
.