public void TestSubstringOnANTLRStringStream() { ANTLRStringStream stream = new ANTLRStringStream("One\r\nTwo\r\nThree"); Assert.AreEqual("Two", stream.Substring(5, 7)); Assert.AreEqual("One", stream.Substring(0, 2)); Assert.AreEqual("Three", stream.Substring(10, 14)); stream.Consume(); Assert.AreEqual("Two", stream.Substring(5, 7)); Assert.AreEqual("One", stream.Substring(0, 2)); Assert.AreEqual("Three", stream.Substring(10, 14)); }
public string Substring(int start, int stop) { return(stream.Substring(start, stop)); }