Hi,
I'm having trouble with 'stringBuilder'. this the snippet of code:
using (StreamReader sr = new StreamReader("file.txt"))
{
word = sr.ReadLine();
listBox1.Items.Add(word.ToString());
label1.Text = word.Length.ToString();
StringBuilder sb = wr.GetStringBuilder();
sb.Remove(0,word.Length);
}
it gives this error:
"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"
I have tried all sorts of things, and I realise that the computer thinks that it is a negative number (which it isn't). Any help would be much appreciated.
Thanks