We want to add a special case formatting to multiline strings with
trimIndent()
/
trimMargin()
and wanted to hear your thoughts about it.
We'll use the poll results to guide our approach.
Feel free to suggest alternatives as well, but do keep in mind this has to work with all the different use cases, which the represented code here for sure does not cover.
Option 1
val a =
"""
a multiline
string
"""
.trimIndent()
.nextMethod()
val b =
"""
|a multiline
| string
|"""
.trimMargin()
.nextMethod()
Option 2
val a =
"""
a multiline
string
"""
.trimIndent()
.nextMethod()
val b =
"""
|a multiline
| string
|"""
.trimMargin()
.nextMethod()
Option 3
val a =
"""
a multiline
string
"""
.trimIndent()
.nextMethod()
val b =
"""
|a multiline
| string
|"""
.trimMargin()
.nextMethod()
Option 4
val a =
"""
a multiline
string
""".trimIndent()
.nextMethod()
val b =
"""
|a multiline
| string
|""".trimMargin()
.nextMethod()