StringIndentation extension
Extension methods for easier indentation of strings while preserving relative indentation.
- on
Methods
-
getIndentationLevel(
) → int -
Available on String, provided by the StringIndentation extension
Returns the indentation level of this string. -
indent(
int indentationLevel) → String -
Available on String, provided by the StringIndentation extension
Returns this string withindentationLevel
applied while preserving relative indentation. -
indentBy(
int howMuch) → String -
Available on String, provided by the StringIndentation extension
Returns this string with indentation level changed byhowMuch
. -
trimMargin(
[String marginPrefix = '|']) → String -
Available on String, provided by the StringIndentation extension
Returns this string, but trims leading whitespace characters followed by the givenmarginPrefix
from each line. -
unindent(
) → String -
Available on String, provided by the StringIndentation extension
Returns this string with all extra indentation stripped while preserving the relative indentation.