This may be stating the obvious, but if we had built-in range types, Stephen's slicing problem could be solved with int..int f(const(char)[] s) { return X..Y; } and at the call site s = s[f(s)];