The OpenD Programming Language

detab

Replace each tab character in s with the number of spaces necessary to align the following character at the next tab stop.

pure
detab
(
Range
)
(
auto ref Range s
,
size_t tabSize = 8
)
if (
__traits(compiles, StringTypeOf!Range)
)

Parameters

s Range

string

tabSize size_t

distance between tab stops

Return Value

Type: auto

GC allocated string with tabs replaced with spaces

Examples

assert(detab(" \n\tx", 9) == " \n         x");

Meta