Here is simple way to get file name or extension of the file at specified string. you need to use System.IO namespace e.g. string path = "http://revenmerchantservices.com/default.aspx"; string fileName = System.IO.Path.GetFileName(path)); To get extension you can use GetExtension function Now, you learned this technique hope you will use it instead of writting your own logic.
Currently rated 5.0 by 1 people
Satalaj
I'm Satalaj.
↑ Grab this Headline Animator
Get notified when a new post is published.