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

U_STABLE int32_t U_EXPORT2 uset_span ( const USet set,
const UChar *  s,
int32_t  length,
USetSpanCondition  spanCondition 
)

Returns the length of the initial substring of the input string which consists only of characters and strings that are contained in this set (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), or only of characters and strings that are not contained in this set (USET_SPAN_NOT_CONTAINED). See USetSpanCondition for details. Similar to the strspn() C library function. Unpaired surrogates are treated according to contains() of their surrogate code points. This function works faster with a frozen set and with a non-negative string length argument.

Parameters:
set the set
s start of the string
length of the string; can be -1 for NUL-terminated
spanCondition specifies the containment condition
Returns:
the length of the initial substring according to the spanCondition; 0 if the start of the string does not fit the spanCondition ICU 3.8
See also:
USetSpanCondition

Definition at line 206 of file uset.cpp.

                                                                                            {
    return ((UnicodeSet*) set)->UnicodeSet::span(s, length, spanCondition);
}


Generated by  Doxygen 1.6.0   Back to index