Next: , Previous: , Up: Elementary string functions   [Contents][Index]


4.3.5 Searching for a character in a Unicode string

The following function searches for a given Unicode character.

Function: uint8_t * u8_chr (const uint8_t *s, size_t n, ucs4_t uc)
Function: uint16_t * u16_chr (const uint16_t *s, size_t n, ucs4_t uc)
Function: uint32_t * u32_chr (const uint32_t *s, size_t n, ucs4_t uc)

Searches the string at s for uc. Returns a pointer to the first occurrence of uc in s, or NULL if uc does not occur in s.

This function is similar to memchr, except that it operates on Unicode strings.