I am using vb.net 2010, I want to extract the last 2 digits of the current year.
For example, 2013 should return 13.
I am using the following code:
Dim sid_1 As String = Year(Now) 'or Year(Now).ToString
sid_1 = sid_1.Substring(sid_1.Length, 2) 'highlighted error
but it returns an error:
ArgumentOutOfRangeException was unhandled
Index and length must refer to a location with the string.
Parameter name: length