This is a stupid error to have. Using Left and Right you can get the Left X amount of characters from a string. With VB6 if X is more than the number of characters, it gets them all. .Net errors out. So you have to right a protection if statement incase there are not enough characters. Makes code more error prone and verbose for little reason. A program is not a mathematical statement. It’s a creative work and there will always be some sloppiness. Behavior like this in a language is the parent forcing you to color in the lines or throw the whole coloring book away.
VB6
sReturnValue = Left(strValue, nLen)
C#
if (strValue.Length>nLen)
sReturnValue = strValue.Substring(1, nLen);
else
sReturnValue = strValue;