mixing array and string .find()

Jarrett Billingsley jarrett.billingsley at gmail.com
Mon Mar 23 19:32:54 PDT 2009


On Mon, Mar 23, 2009 at 9:11 PM, Denis Koroskin <2korden at gmail.com> wrote:
> Try the following:
>
> int find(T)(T[] array, T obj) if (!is(T : char))
> {
>        foreach (i, v; array) {
>                if (v == obj)
>                        return i;
>        }
>        return -1;
> }
>
>

in D1.


More information about the Digitalmars-d-learn mailing list