Remove filename from path
Jay Norwood via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Sep 25 20:32:43 PDT 2014
On Wednesday, 24 September 2014 at 10:28:05 UTC, Suliman wrote:
>>> string path = thisExePath()
>>
>> Seems like "dirName" in std.path is a good candidate ;)
>> http://dlang.org/phobos/std_path.html#.dirName
>>
>> You'll find many other path manipulation functions there.
>
> Thanks! But if I want to strip it, how I can cut it?
dirName gives the directory, baseName the filename,
stripExtension strips it, so seems like what you want is
dirName ~ stripExtension( baseName )
More information about the Digitalmars-d-learn
mailing list