String library
Types
-
The basic string implementation that is suitable for any character types.
Alias types
-
The string that contains c8 characters.
-
The string that contains wchat_t characters.
-
The string that contains c16 characters.
-
The string that contains c32 characters.
Functions
-
Gets the type object of String.
-
usize strlen(const _CharT *str)
Computes the length (number of characters) of the specified string by searching for the first null character in the string.
-
usize strnlen(const _CharT *str, usize max_chars)
Computes the length (number of characters) of the specified string by searching for the first null character in the string. The search process stops after reading
max_chars
characters. -
_CharT * strncpy(_CharT dst, const _CharT src, usize max_chars)
Copies at most
max_chars
characters fromsrc
todst
, including the null terminator. -
i32 strcmp(const _CharT lhs, const _CharT rhs)
Compares characters in two strings.
-
i32 strncmp(const _CharT lhs, const _CharT rhs, usize max_chars)
Compares at most
max_chars
characters in two strings. -
const _CharT * strchr(const _CharT *str, _CharT ch)
Finds the first occurrence of
ch
in the null-terminated byte string pointed to bystr
. -
_CharT * strchr(_CharT *str, _CharT ch)
Finds the first occurrence of
ch
in the null-terminated byte string pointed to bystr
. -
const _CharT * strrchr(const _CharT *str, _CharT ch)
Finds the last occurrence of
ch
in the null-terminated byte string pointed to bystr
. -
_CharT * strrchr(_CharT *str, _CharT ch)
Finds the last occurrence of
ch
in the null-terminated byte string pointed to bystr
. -
const _CharT * strstr(const _CharT str, const _CharT substr)
Finds the first occurrence of the specified substring in the null-terminated byte string pointed to by
str
. -
_CharT * strstr(_CharT str, const _CharT substr)
Finds the first occurrence of the specified substring in the null-terminated byte string pointed to by
str
. -
i64 strtoi64(const c8 str, c8 *str_end, i32 base)
Interprets an integer value in a string pointed to by
str
. -
u64 strtou64(const c8 str, c8 *str_end, i32 base)
Interprets an unsigned integer value in a string pointed to by
str
. -
f64 strtof64(const c8 str, c8 *str_end)
Interprets a floating-point value in a string pointed to by
str
. -
f32 strtof32(const c8 str, c8 *str_end)
Interprets a floating-point value in a string pointed to by
str
.