← Docs
kotlin-stdlib / kotlin.text / replaceIndentByMargin

replaceIndentByMargin

Common
JVM
JS
Native
1.0
fun String . replaceIndentByMargin (
newIndent : String = "" ,
marginPrefix : String = "|"
) : String

(source)

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

Parameters

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

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .