Exemple #1
0
/* Search for a codepoint in a string that matches one of the matchSet codepoints. */
U_CAPI UChar* U_EXPORT2
u_strpbrk(const UChar* string, const UChar* matchSet) {
    int32_t index = _matchFromSet(string, matchSet, TRUE);
    if (index >= 0) {
        return (UChar*) string + index;
    } else {
        return NULL;
    }
}
Exemple #2
0
/* Search for a codepoint in a string that does not match one of the matchSet codepoints. */
U_CAPI int32_t U_EXPORT2
u_strspn(const UChar* string, const UChar* matchSet) {
    int32_t index = _matchFromSet(string, matchSet, FALSE);
    if (index >= 0) {
        return index;
    } else {
        return -index - 1; /* == u_strlen(string) */
    }
}
Exemple #3
0
/* Search for a codepoint in a string that matches one of the matchSet codepoints. */
U_CAPI int32_t U_EXPORT2
u_strcspn(const UChar *string, const UChar *matchSet)
{
    int32_t idx = _matchFromSet(string, matchSet, TRUE);
    if(idx >= 0) {
        return idx;
    } else {
        return -idx - 1; /* == u_strlen(string) */
    }
}