src/libtsduck/base/tsUString.cpp
bool ts::UString::similar(const UString& other) const
{
    const size_type alen = length();
    const size_type blen = other.length();
    size_type ai = 0;
    size_type bi = 0;

    for (;;) {
        // Skip spaces
        while (ai < alen && IsSpace(at(ai))) {
            ai++;
        }
        while (bi < blen && IsSpace(other.at(bi))) {
            bi++;
        }
        if (ai >= alen && bi >= blen) {
            return true;
        }
        if (ai >= alen || bi >= blen || ToLower(at(ai)) != ToLower(other.at(bi))) {
            return false;
        }
        ai++;
        bi++;
    }
}
//----------------------------------------------------------------------------
// Check if two strings are identical, case-insensitive and ignoring blanks
//----------------------------------------------------------------------------
Check if two strings are identical, case-insensitive and ignoring blanks
Check if two strings are identical case - insensitive and ignoring blanks
bool ts::UString::similar(const UString& other) const
{
    const size_type alen = length();
    const size_type blen = other.length();
    size_type ai = 0;
    size_type bi = 0;
    for (;;) {
        while (ai < alen && IsSpace(at(ai))) {
            ai++;
        }
        while (bi < blen && IsSpace(other.at(bi))) {
            bi++;
        }
        if (ai >= alen && bi >= blen) {
            return true;
        }
        if (ai >= alen || bi >= blen || ToLower(at(ai)) != ToLower(other.at(bi))) {
            return false;
        }
        ai++;
        bi++;
    }
}
bool ts :: UString :: similar ( const UString & other ) const { const size_type alen = length ( ) ; const size_type blen = other . length ( ) ; size_type ai = 0 ; size_type bi = 0 ; for ( ; ; ) { while ( ai < alen && IsSpace ( at ( ai ) ) ) { ai ++ ; } while ( bi < blen && IsSpace ( other . at ( bi ) ) ) { bi ++ ; } if ( ai >= alen && bi >= blen ) { return true ; } if ( ai >= alen || bi >= blen || ToLower ( at ( ai ) ) != ToLower ( other . at ( bi ) ) ) { return false ; } ai ++ ; bi ++ ; } }
Check if two strings are identical, case-insensitive and ignoring blanks
Check if two strings are identical case - insensitive and ignoring blanks
// Skip spaces