Example #1
0
            /// <summary>
            /// Checks if the stream continues with the given word.
            /// </summary>
            /// <param name="word">The word to check for.</param>
            /// <returns>True if it continues, otherwise false.</returns>
            public Boolean ContinuesWith(String word)
            {
                if (_texts.Count == 0)
                {
                    return(_base.ContinuesWith(word, false));
                }

                var pos  = _pos.Peek();
                var text = _texts.Peek();

                if (text.Length - pos < word.Length)
                {
                    return(false);
                }

                for (int i = 0; i < word.Length; i++)
                {
                    if (text[i + pos] != word[i])
                    {
                        return(false);
                    }
                }

                return(true);
            }