I need to trim everything preceding the last / in a string. for example if the string were "C:\Files\New\program.exe" all I want is the "program.exe portion.
How would I go about doing this
Printable View
I need to trim everything preceding the last / in a string. for example if the string were "C:\Files\New\program.exe" all I want is the "program.exe portion.
How would I go about doing this
if you want this to get file names you can use
vb Code:
io.path.getfilename(fname)
otherwise something like this will work
vb Code:
s = mystring.substring(mystring.lastindex("/"))
or something like that
kevin
thank you
Hey,
When it comes to files and file paths, there are a number of methods available that replace the way things used to be done, i.e. with substring. GetFileName is just one of them.
You can see them all here:
http://msdn.microsoft.com/en-gb/libr...h_members.aspx
Hope that helps!!
Gary