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

U_STABLE int32_t U_EXPORT2 u_strcspn ( const UChar *  string,
const UChar *  matchSet 
)

Returns the number of consecutive characters in string, beginning with the first, that do not occur somewhere in matchSet. Works just like C's strcspn but with Unicode.

Parameters:
string The string in which to search, NUL-terminated.
matchSet A NUL-terminated string defining a set of code points for which to search in the text string.
Returns:
The number of initial characters in string that do not occur in matchSet.
See also:
u_strspn ICU 2.0

Definition at line 549 of file ustring.c.

References TRUE.

{
    int32_t idx = _matchFromSet(string, matchSet, TRUE);
    if(idx >= 0) {
        return idx;
    } else {
        return -idx - 1; /* == u_strlen(string) */
    }
}


Generated by  Doxygen 1.6.0   Back to index