How many spaces make up a tab.
String to indent the lines of.
Amount of tabs to indent with, default 1.
How many lines to skip indenting.
A string with all the lines of the original string indented.
immutable string_ = "Lorem ipsum sit amet I don't remember any more offhand so shrug"; immutable indentedOne = string_.indent; assert((indentedOne == " Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ indentedOne); immutable indentedTwo = string_.indent(2); assert((indentedTwo == " Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ indentedTwo); immutable indentedZero = string_.indent(0); assert((indentedZero == "Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ indentedZero); immutable indentedSkipTwo = string_.indent(1, 2); assert((indentedSkipTwo == "Lorem ipsum sit amet I don't remember any more offhand so shrug"), '\n' ~ indentedSkipTwo);
Indents lines in a string with the supplied number of tabs. Returns a newly allocated string.