Find a substring in a string.
#include <ldap_utf8.h>
ber_len_t ldap_x_utf8_strcspn (
const char *str,
const char *set);
(IN) Null-terminated UTF-8 string to search.
(IN) Null-terminated character set.
Returns the length of the initial segment of str that consists entirely of characters not in set.
This function returns the number of bytes, not characters.
char utstr[] = { ’a’, ’b’, 0xe2U, 0x98U, 0xa0U, ’x’, ’y’, 0 };
char set[] = { ’x’, 0xe2U, 0x98U, 0xa0U, 0 };
int n = ldap_x_utf8_strcspn(utstr, set); /* Returns 2 */