Lucene.Net.Analysis.Tokenattributes.CharTermAttribute.SetEmpty C# (CSharp) Method

SetEmpty() public method

public SetEmpty ( ) : ICharTermAttribute
return ICharTermAttribute
        public ICharTermAttribute SetEmpty()
        {
            TermLength = 0;
            return this;
        }

Usage Example

示例#1
0
        public virtual void TestToString()
        {
            char[]            b = new char[] { 'a', 'l', 'o', 'h', 'a' };
            CharTermAttribute t = new CharTermAttribute();

            t.CopyBuffer(b, 0, 5);
            Assert.AreEqual("aloha", t.ToString());

            t.SetEmpty().Append("hi there");
            Assert.AreEqual("hi there", t.ToString());
        }
All Usage Examples Of Lucene.Net.Analysis.Tokenattributes.CharTermAttribute::SetEmpty