Esempio n. 1
0
    internal bool Equals(Strip other)
    {
        ResetCurrentIndex();
        other.ResetCurrentIndex();

        char thisChar;

        do
        {
            thisChar = GetNextChar();

            if (!AreCharsEqual(thisChar, other.GetNextChar()))
            {
                return(false);
            }
        } while (thisChar != END_OF_STRING);

        return(true);
    }
Esempio n. 2
0
    private bool StartsWith(Strip other)
    {
        ResetCurrentIndex();
        other.ResetCurrentIndex();

        while (true)
        {
            char otherChar = other.GetNextChar();
            if (otherChar == END_OF_STRING)
            {
                break;
            }

            char thisChar = GetNextChar();

            if (!AreCharsEqual(thisChar, otherChar))
            {
                return(false);
            }
        }

        return(true);
    }