How many spaces make up an indentation.
String to indent the lines of.
Output range to fill with the indented lines.
Amount of tabs to indent with, default 1.
How many lines to skip before starting to indent.
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[] == " Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ sink[]); sink.clear(); string_.indentInto!3(sink, 2); assert((sink[] == " Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ sink[]); sink.clear(); string_.indentInto(sink, 0); assert((sink[] == "Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ sink[]);
Indents lines in a string into an output range sink with the supplied number of space-based tabs.