Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE UChar* U_EXPORT2 u_strchr ( const UChar *  s,
UChar  c 

Find the first occurrence of a BMP code point in a string. A surrogate code point is found only if its match in the text is not part of a surrogate pair. A NUL character is found at the string terminator.

s The string to search (NUL-terminated).
c The BMP code point to find.
A pointer to the first occurrence of c in s or NULL if c is not in s. ICU 2.0
See also:




Definition at line 195 of file ustring.c.

References NULL, and U16_IS_SURROGATE.

    if(U16_IS_SURROGATE(c)) {
        /* make sure to not find half of a surrogate pair */
        return u_strFindFirst(s, -1, &c, 1);
    } else {
        UChar cs;

        /* trivial search for a BMP code point */
        for(;;) {
            if((cs=*s)==c) {
                return (UChar *)s;
            if(cs==0) {
                return NULL;

Generated by  Doxygen 1.6.0   Back to index