GetDirectoryName(Path: String): String;
Path — path to a file or a folder.
The GetDirectoryName method returns information about a folder for the specified path.
Sub Main;
Var
Path_File, s: String;
Begin
Path_File:="c:\Work\1.txt";
s:=Path.GetDirectoryName(Path_File);
End Sub Main;
After executing the example, the "s" variable contains a path to a folder that contains the 1.txt file.
See also: