Next: , Previous: , Up: Elementary string functions on NUL terminated strings   [Contents][Index]


4.5.6 Searching for a character in a NUL terminated Unicode string

The following functions search for a given Unicode character.

Function: uint8_t * u8_strchr (const uint8_t *str, ucs4_t uc)
Function: uint16_t * u16_strchr (const uint16_t *str, ucs4_t uc)
Function: uint32_t * u32_strchr (const uint32_t *str, ucs4_t uc)

Finds the first occurrence of uc in str.

This function is similar to strchr and wcschr, except that it operates on Unicode strings.

Function: uint8_t * u8_strrchr (const uint8_t *str, ucs4_t uc)
Function: uint16_t * u16_strrchr (const uint16_t *str, ucs4_t uc)
Function: uint32_t * u32_strrchr (const uint32_t *str, ucs4_t uc)

Finds the last occurrence of uc in str.

This function is similar to strrchr and wcsrchr, except that it operates on Unicode strings.

The following functions search for the first occurrence of some Unicode character in or outside a given set of Unicode characters.

Function: size_t u8_strcspn (const uint8_t *str, const uint8_t *reject)
Function: size_t u16_strcspn (const uint16_t *str, const uint16_t *reject)
Function: size_t u32_strcspn (const uint32_t *str, const uint32_t *reject)

Returns the length of the initial segment of str which consists entirely of Unicode characters not in reject.

This function is similar to strcspn and wcscspn, except that it operates on Unicode strings.

Function: size_t u8_strspn (const uint8_t *str, const uint8_t *accept)
Function: size_t u16_strspn (const uint16_t *str, const uint16_t *accept)
Function: size_t u32_strspn (const uint32_t *str, const uint32_t *accept)

Returns the length of the initial segment of str which consists entirely of Unicode characters in accept.

This function is similar to strspn and wcsspn, except that it operates on Unicode strings.

Function: uint8_t * u8_strpbrk (const uint8_t *str, const uint8_t *accept)
Function: uint16_t * u16_strpbrk (const uint16_t *str, const uint16_t *accept)
Function: uint32_t * u32_strpbrk (const uint32_t *str, const uint32_t *accept)

Finds the first occurrence in str of any character in accept.

This function is similar to strpbrk and wcspbrk, except that it operates on Unicode strings.


Next: Searching for a substring in a NUL terminated Unicode string, Previous: Duplicating a NUL terminated Unicode string, Up: Elementary string functions on NUL terminated strings   [Contents][Index]