Write the shortest possible code which converts tabs to spaces in the input. Tab size should be supplied as a parameter or be hardcoded in the code in a single place.
Spaces on output should point to the right column, e.g. (\t
represents a tab character):
a\tb
aa\tb
aaa\tb
aaaa\tb
should become (for tab size 4):
a b
aa b
aaa b
aaaa b
Of course there can be more than one tab in a line.
Line separator and tab character should match the system defaults (e.g. ASCII 10 and 9 on Unix).
expand
which does just this. \$\endgroup\$