I have multiple files with date and each file has different length of file name.
I would like to cut the string to only get the file name. The way I do it in Sql is REVERSE(SUBSTRING(REVERSE('the full file name'), 10, LEN('the full file name')))
Example File names:
Something like this.
Dim s As String = "Myfile_20160708" If s.Contains("_"c) Then s = s.Substring(0, s.IndexOf("_"c)) End If
uses Indexof to find the location of the underscore and substring to get the part you are interested in