Quote Originally Posted by peterst View Post
Split the text by Chr(10) (line feed) and get last line:

VB.NET Code:
  1. Dim lines() = TextBox1.Text.Split(Chr(10))
  2. Dim lastLine = lines.Last()
Actually, that code is bad. You are splitting only on line feed characters so you are leaving the carriage returns in the results. That could cause problems if you ever need to compare Strings or in various other situations. If you were going to use Split, you should split on all possible line breaks. Using the Lines property will do that automatically.