[ACCEPTED]-how to parse out image name from image url-url
Accepted answer
string fileName = Path.GetFileName(@"http://www.google.com/test/test23/image1.jpg");
0
As long as your sure its an image file you 1 can just use the path class.
public static void doSomething() {
string url = "http:\\www.google.com\image1.jpg";
string imageFileName = url.Substring( url.LastIndexOf( '\\' ) + 1 );
}
0
Not the best, but a certainly a way
url = "blahblah\image1.jpg"
string imageName = url.substring(url.lastindexof("\") + 1);
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.