Link to home
Start Free TrialLog in
Avatar of metropia
metropiaFlag for United States of America

asked on

get file name that contains date from URL

I would like to know a good way to split a URL in vb.NET:

ftp://ftp-test.site.com/To_Directory/204_20130925_132605.txt

and get the file name (incl. ext)

204_20130925_132605.txt

thank you for your help.
SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of metropia

ASKER

what about:
inFullPath As String = "ftp://ftp-test.site.com/To_Directory/204_20130925_132605.txt"
outFileName = inFullPath.Substring(inFullPath.LastIndexOf("/") + 1)
Return outFileName

Open in new window

That should work as well. There are several ways to do that.
Thank you experts!