Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
E:\Samples\images\systemimages\trafic.jpg

I need the last test trafic.jpg

using substring please provide me the c# code.
Posted
Comments
Sergey Alexandrovich Kryukov 19-Aug-11 0:38am    
Not a question. "Using substring"...
--SA

1 solution

Use System.IO.Path instead. It contains several methods that allows you to get various parts of the path.

C#
string filename = System.IO.Path.GetFilename(@"c:\filepath\myfile.xyz");


will result in filename being "myfile.xyz
 
Share this answer
 
Comments
Simon Bang Terkildsen 18-Aug-11 9:20am    
+5
fjdiewornncalwe 18-Aug-11 13:54pm    
Can't get easier than that. +5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900