DEV Community


Posted on

Margin Indentation In Strings | Problem

Hello guys,
I was practising some of Kotlin on the coding ground.
It's about margin indentation. I practised using the pipe with the function .trimMargin(). And I applied it correctly.
Now, I'm trying the triangle prefix. But it doesn't work.
Here's the link if you want to check.

Discussion (2)

theimpulson profile image
Aayush Gupta • Edited on

Replace : in .trimMargin(marginPrefix: ">") method with =
Also, you have used 4 double quotes at the end of the string, might want to fix that too.

fun main(args: Array <String>){
    val rawCrawl1= """>A long time ago,
    >a glaxy
    >far, far, away.
    >BUMM BUMM BUMMMM""".trimMargin(marginPrefix= ">")

Enter fullscreen mode Exit fullscreen mode
robiabo profile image
Robiabo Author

I applied what you mentioned and it works. Thanks a lot.