string path = "D:/new/image.jpg"; int pos = path.LastIndexOf("/") + 1; Console.WriteLine(path.Substring(pos, path.Length - pos)); // prints "image.jpg"
string.indexOf
string.substring
string.split
string Path = "D:/new/image.jpg"; string[] tempArr=Path.Split('/'); string path = tempArr[tempArr.Length - 1].ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)