Feeling dumb, I'm trying to remove a sub string after the last occurrence of a ".". The code is as follows:
Dim dotIndex As Integer = fileNameCopy.LastIndexOf(".")
Dim dummy As Integer = fileNameCopy.Length - 1
fileNameCopy = fileNameCopy.Remove(dotIndex, dummy)
When I debug, I get an argument out of range exception for the second, counter, parameter; dummy in this case. I'm not sure why; the total length of my test string is 72, when debugging, the dotIndex is 68 and the length is 71, so I'm within the bounds of the string, I'm not sure why I'm getting this error, any help is appreciated.