Found this nice utility class while browsing through the reflector. It provides utility methods for common operations involving virtual paths.
Here's an example taken from the msdn page.
StringBuilder sb = new StringBuilder();
String pathstring = Context.Request.FilePath.ToString();
sb.Append("Current file path = " + pathstring + "<br>");
sb.Append("File name = " + VirtualPathUtility.GetFileName(pathstring).ToString() + "<br>");
sb.Append("File extension = " + VirtualPathUtility.GetExtension(pathstring).ToString() + "<br>");
sb.Append("Directory = " + VirtualPathUtility.GetDirectory(pathstring).ToString() + "<br>");
Response.Write(sb.ToString());
StringBuilder sb2 = new StringBuilder();
String pathstring1 = Context.Request.CurrentExecutionFilePath.ToString();
sb2.Append("Current Executing File Path = " + pathstring1.ToString() + "<br>");
sb2.Append("Is Absolute = " + VirtualPathUtility.IsAbsolute(pathstring1).ToString() + "<br>");
sb2.Append("Is AppRelative = " + VirtualPathUtility.IsAppRelative(pathstring1).ToString() + "<br>");
sb2.Append("Make AppRelative = " + VirtualPathUtility.ToAppRelative(pathstring1).ToString() + "<br>");
Response.Write(sb2.ToString());
Read more about it
here.