I want to split this text in to 2 parts with C#.Net windows application.
C:\Users\Microsoft\Pictures\2010-04-22\003.jpg
First part: C:\Users\Microsoft\Pictures\2010-04-22\
Second part: 003.jpg
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are working with files and paths, use FileInfo:
Or, as Marcelo Cantos says, you can use System.IO.Path. Using Reflector you can see that FileInfo.Directory name calls Path.GetDirectoryName(base.FullPath) so it’s very much the same