Expand description
Safe equivalents of functions declared in C’s string.h header.
Functions§
- memchr
- Finds
c, converted tou8, inbufand returns its suffix, orNoneif not found. - memchr_
mut - Finds
c, converted tou8, inbufand returns its mutable suffix, orNoneif not found. - memcmp
- Compares the first
nbytes of two memory regions. - strcat
- Appends the null-terminated byte string
s2tos1. - strchr
- Finds
c, converted toi8, in null-terminatedsand returns its suffix, orNoneif not found. - strchr_
mut - Finds
c, converted toi8, in null-terminatedsand returns its mutable suffix, orNoneif not found. - strcmp
- Compares two null-terminated byte strings.
- strcpy
- Copies the null-terminated byte string
s2, including its null byte, intos1. - strcspn
- Returns the length of the initial segment of null-terminated
s1containing no bytes from null-terminateds2. - strdup
- Duplicates the null-terminated byte string
s. - strlen
- Returns the number of bytes preceding the first null byte in
s. - strncat
- Appends at most
nbytes froms2to the null-terminated byte strings1. - strncmp
- Compares at most
nbytes of two byte strings. - strncpy
- Copies at most
nbytes froms2intos1, padding with null bytes when needed. - strndup
- Duplicates at most
nbytes fromsand appends a null byte. - strrchr
- Finds the last
c, converted toi8, in null-terminatedsand returns its suffix, orNoneif not found. - strrchr_
mut - Finds the last
c, converted toi8, in null-terminatedsand returns its mutable suffix, orNoneif not found. - strspn
- Returns the length of the initial segment of null-terminated
s1containing only bytes from null-terminateds2. - strstr
- Finds null-terminated
s2in null-terminateds1and returns its suffix, orNoneif not found. - strstr_
mut - Finds null-terminated
s2in null-terminateds1and returns its mutable suffix, orNoneif not found.