ldap_x_utf8_strspn

Find the first substring.

Library:*ldapsdk.*
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap_utf8.h>
  
  ber_len_t ldap_x_utf8_strspn (
     const char *str,
     const char *set);
  

Parameters

str

(IN) Null-terminated UTF-8 string to search.

set

(IN) Null-terminated character set.

Return Values

Returns the length of the substring in str that consists entirely of characters in set.

Remarks

This function returns the number of bytes, not characters.

Example

  char utstr[] = { ’a’, ’b’, 0xe2U, 0x98U, 0xa0U, ’x’, ’y’, 0 };
  char set[] = { ’b’, 0xe2U, 0x98U, 0xa0U, ’a’, 0 };
  int n = ldap_x_utf8_strspn(utstr, set);    /* Returns 5 */