How many spaces in an indenting tab.
String to indent the individual lines of.
Output range to fill with the indented lines.
Optional amount of tabs to indent with, default 1.
How many lines to skip indenting.
import std.array : Appender; Appender!(char[]) sink; immutable string_ = "Lorem ipsum sit amet I don't remember any more offhand so shrug"; string_.indentInto(sink); assert((sink.data == " Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ sink.data); sink.clear(); string_.indentInto!3(sink, 2); assert((sink.data == " Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ sink.data); sink.clear(); string_.indentInto(sink, 0); assert((sink.data == "Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ sink.data);
Indents lines in a string into an output range sink with the supplied number of tabs.