No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hello, I was just wondering how I would refer to a certain line in a text file. It is by using an index of some sort? here is my try: [code]using (StreamReader worldlist = new StreamReader("wordlist.txt")) { string line; line = worldlist.ReadLine(count); listBox1.Items.Add(line); } [/code] Unfortunately the error is "No … |
|
Hi, I'm having trouble with 'stringBuilder'. this the snippet of code: [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(); [COLOR="Red"]sb.Remove(0,word.Length);[/COLOR] }[/CODE] it gives this error: "Index was out of range. Must be non-negative and less than the size of the … |