On 4/1/11, Andrej Mitrovic <n...@none.none> wrote:
> I often have to search for files that have a certain extension. Having to
> expand the code to the following becomes ugly real fast:
>
> foreach (string name; dirEntries(curdir, SpanMode.shallow))
> {
>     if (name.isFile && name.hasExt.tolower == "ini" ||
>                    name.hasExt.tolower == "conf"))
>     {
>         // do something
>     }
> }
>

Oops, that showcase was supposed to use `getExt`.

Reply via email to