string or forward range
distance between tab stops
lazy forward range with tabs replaced with spaces
import std.array : array; import std.utf : byChar, byWchar; assert(detabber(" \u2029\t".byChar, 9).array == " \u2029 "); auto r = "hel\tx".byWchar.detabber(); assert(r.front == 'h'); auto s = r.save; r.popFront(); r.popFront(); assert(r.front == 'l'); assert(s.front == 'h');
import std.array : array; assert(detabber(" \n\tx", 9).array == " \n x");
Replace each tab character in r with the number of spaces necessary to align the following character at the next tab stop.