Remove filename from path

monarch_dodra via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 24 05:02:49 PDT 2014


On Wednesday, 24 September 2014 at 10:35:29 UTC, Suliman wrote:
> I can't understand how to use strip? For example I would like 
> to cut just extension.
>
> path = path.stripRight("exe");
> Error: no overload matches for stripRight(C)(C[] str) if

"stripExtension" would be your friend here.

If you want the extension, then "extension".

As a general rule, everything you need to manipulate paths and 
filenames is in std.path:
http://dlang.org/phobos/std_path.html


More information about the Digitalmars-d-learn mailing list