Ok, here is my function which works as expected:

---------------------------------------------------------------
string[] explode(in string source, char separator) {
        typeof(return) result;
        size_t prev = 0;
        foreach (i, c; source) {
                if (c == separator) {
                        result ~= source[prev .. i];
                        prev = i + 1;
                }
        }
        result ~= source[prev .. $];
        return result;
}
---------------------------------------------------------------

But, as I sad already, I would really like to use library function..

Reply via email to