Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool isPath = System.IO.Path.GetDirectoryName(@"C:MyFolderSomeFile.exe -i -d") != String.Empty;
- if (isPath)
- {
- Console.WriteLine("The string contains a path");
- }
- C:My FolderSome File.exe -i -d
- =>
- C:My FolderSome File.exe -i -d (no, although it might exist!)
- C:My FolderSome File.exe -i (no)
- C:My FolderSome File.exe (yes => That's this one)
Add Comment
Please, Sign In to add comment