I have a multiline textbox that constantly gets updated. I need to read only the last word/sentence in the textbox.
string lastLine = textBox1.ReadLine.Last(
Try this:
if (textBox1.Lines.Any()) { string lastLine = textBox1.Lines[textBox1.Lines.Length - 1]; }
And for last word:
string lastword = lastLine.Split(' ').Last();