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

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

Returns the number of consecutive characters in string, beginning with the first, that occur somewhere in matchSet. Works just like C's strspn 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 occur in matchSet.
See also:
u_strcspn ICU 2.0

Definition at line 561 of file ustring.c.

References FALSE.

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


Generated by  Doxygen 1.6.0   Back to index