I searched for more than an hour, and I can’t understand in my whole life how to search for a string variable, starting with the right one. I want to do to get the last path folder (right in front of the file name), In VB6 I would do something like this:
Dim s As String s = "C:\Windows\System32\Foo\Bar\" Debug.Print Mid(s, InStrRev(Left(s, Len(s) - 1), "\") + 1)
Here is what I have tried so far:
string s = "C:\\Windows\System32\\Foo\\Bar\\"; s = agencyName.Substring(s.LastIndexOf("\\") + 1)
string c #
Mark kram
source share