The OpenD Programming Language

entab

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

entab
(
Range
)
(
Range s
,
size_t tabSize = 8
)

Parameters

s Range

String to convert.

tabSize size_t

Tab columns are tabSize spaces apart.

Return Value

Type: auto

GC allocated string with spaces replaced with tabs; use entabber to not allocate.

Examples

assert(entab("        x \n") == "\tx\n");

See Also

Meta