replaceIndentByMargin

fun String.replaceIndentByMargin(newIndent: String = "", marginPrefix: String = "|"): String(source)

Detects indent by marginPrefix as it does trimMargin and replace it with newIndent.

Since Kotlin

1.0

Parameters

marginPrefix

non-blank string, which is used as a margin delimiter. Default is | (pipe character).