I was just wondering if there is a possible way to get the last 4 characters from a label or textbox. If someone could please provide me with an example that would be great!

Thanks..

use like this :

 Dim str As String
        str = TextBox1.Text.Substring(Math.Max(0, TextBox1.Text.Length - 4))
        MsgBox(str)
use like this :

 Dim str As String
        str = TextBox1.Text.Substring(Math.Max(0, TextBox1.Text.Length - 4))
        MsgBox(str)

That seems to work. Thanks guys... :D

Yeah, this also works:

str.Substring((Math.Max(0, (str.Length - 4) * Convert.ToInt32( Math.Sin( 4.0 * Math.Atan(1.0) / 2)))))

What is wrong with:

str.Substring(str.Length - 4)

This also does the job.

This question has already been answered. Start a new discussion instead.