GitSharp.Core.Util.IntList.toString C# (CSharp) Method

toString() public method

public toString ( ) : string
return string
        public string toString()
        {
            var r = new StringBuilder();
            r.Append('[');
            for (int i = 0; i < count; i++)
            {
                if (i > 0)
                    r.Append(", ");
                r.Append(entries[i]);
            }
            r.Append(']');
            return r.ToString();
        }

Usage Example

Example #1
0
 public void testToString()
 {
     IntList i = new IntList();
     i.add(1);
     Assert.AreEqual("[1]", i.toString());
     i.add(13);
     i.add(5);
     Assert.AreEqual("[1, 13, 5]", i.toString());
 }