entabber

Replaces spaces in range r with the optimal number of tabs. All spaces and tabs at the end of a line are removed.

entabber
(
Range
)
(
Range r
,
size_t tabSize = 8
)

Parameters

r Range

string or forward range

tabSize size_t

distance between tab stops

Return Value

Type: auto

lazy forward range with spaces replaced with tabs

Examples

import std.array : array;
assert(entabber("        x \n").array == "\tx\n");

See Also

Meta