private bool PeekAndDiscard(char ch) { if (str[i] == ch) { ++i; return true; } else { return false; } }