Description |
The exact value returned is platform dependant. On the Windows platform, if PathString contains an absolute path, the root is the device, such as C:\, where C is a designated letter for a device such as a hard disk drive.
If the path is relative, an empty string is returned.
|
|
Microsoft MSDN Links |
System.IO
System.IO.Path
|
|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
uses
System.IO;
var
PathString : String;
begin
PathString := 'C:\Delphi\DelphiBasics.txt';
Console.WriteLine('{0} path root : "{1}"',
PathString,
System.IO.Path.GetPathRoot(PathString));
Console.Readline;
end.
| Show full unit code | C:\Delphi\DelphiBasics.txt path root : "C:\"
|
|
|
|