ShareThis

Wednesday, February 8, 2012

[C#] Get Extension part of Url


You can split it on .:
string url = "www.abc.com/files.zip";
string lastPart = url.Split(new char[] {'.'}).Last()
lastPart == "zip"

0 comments:

Post a Comment