Foggy day

Kotlin - trimMargin, multiple line string 본문

Kotlin

Kotlin - trimMargin, multiple line string

jinhan38 2021. 3. 19. 00:12

If you want to display multiple lines, you can use triple quotes(""") and trimMargin().

  println("""Example of Jinhan : It is about String
            |First line 
            |Second line
            |Third line
            |Fourth line
        """.trimMargin())

 

'Kotlin' 카테고리의 다른 글

Kotlin - lambda expression -2 : function composition  (0) 2021.03.20
Kotlin - lambda expression -1  (0) 2021.03.20
Kotlin - Kotlin casting, smart cast  (0) 2021.03.19
Kotlin - Elvis, null check  (0) 2021.03.17
Kotlin - anonymous function  (0) 2021.03.17