http://d.puremagic.com/issues/show_bug.cgi?id=3786



--- Comment #1 from Igor Lesik <curo...@yahoo.com> 2010-02-09 18:50:30 PST ---
Just in case, the correct version of the function might look like:

string removechars(string s, in string pattern)
{
    char[] r;
    bool changed = false;

    foreach (size_t i, dchar c; s)
    {
        if (inPattern(c, pattern)){
                if (!changed)
                {   changed = true;
                    r = s[0 .. i].dup;
                }
                continue;
        }
        if (changed)
        {
            std.utf.encode(r, c);
        }
    }
    return (changed? r.idup : s);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to