Mstdlib-1.24.0
|
Functions | |
char * | M_str_chr (const char *s, char c) M_WARN_UNUSED_RESULT |
char * | M_str_rchr (const char *s, char c) M_WARN_UNUSED_RESULT |
char * | M_str_find_first_from_charset (const char *str, const char *charset) |
char * | M_str_find_first_not_from_charset (const char *str, const char *charset) |
char * | M_str_str (const char *haystack, const char *needle) M_WARN_UNUSED_RESULT |
char * | M_str_casestr (const char *haystack, const char *needle) M_WARN_UNUSED_RESULT |
ssize_t | M_str_casestr_pos (const char *haystack, const char *needle) M_WARN_UNUSED_RESULT |
String Searching
char * M_str_chr | ( | const char * | s, |
char | c | ||
) |
Find the first occurrence of c in s.
[in] | s | NULL-terminated string. |
[in] | c | Character to search for. |
char * M_str_rchr | ( | const char * | s, |
char | c | ||
) |
Find the last occurrence of c in s.
[in] | s | NULL-terminated string. |
[in] | c | Character to search for. |
char * M_str_find_first_from_charset | ( | const char * | str, |
const char * | charset | ||
) |
Find the first occurence in str of any character in charset.
This is identical to C standard function strpbrk(), except that it treats NULL pointers as empty strings instead of segfaulting.
[in] | str | string to search in (stored as NULL-terminated C string). |
[in] | charset | list of chars to search for (stored as NULL-terminated C string). |
char * M_str_find_first_not_from_charset | ( | const char * | str, |
const char * | charset | ||
) |
Find the first occurence in str of any character that's not in charset.
[in] | str | string to search in (stored as NULL-terminated C string). |
[in] | charset | list of chars to skip (stored as NULL-terminated C string). |
char * M_str_str | ( | const char * | haystack, |
const char * | needle | ||
) |
A wrapper around strstr that treats NULL as the empty string.
[in] | haystack | String to search. |
[in] | needle | String to search for in haystack. |
char * M_str_casestr | ( | const char * | haystack, |
const char * | needle | ||
) |
A wrapper around strstr that ignores case and treats NULL as the empty string.
[in] | haystack | String to search. |
[in] | needle | String to search for in haystack. |
ssize_t M_str_casestr_pos | ( | const char * | haystack, |
const char * | needle | ||
) |
A wrapper around strstr that ignores case and treats NULL as the empty string.
[in] | haystack | String to search. |
[in] | needle | String to search for in haystack. |