If using the following in an if statement I get an error:
If trg.Name.Substring(4, 6).ToUpper <> ("ABCDEF") Then
I get the error:
“Index and length must refer to a location within the string. Parameter name: length”
I assume this is because the string (trg.name) is too small for the 4, 6 substring.
What would be the correct method of working around this problem?
Thanks,
madlan.
VB.net Studio 2008.
1 Answer