Thursday, 2 May 2019

Go language: multi line strings


`(backtick) sign is used to construct multi-line strings.

App.go
package main

import "fmt"

func main() {

 var msg string = `Hello,
 How are you
 I am fine, thank you
 ........`

 fmt.Println(msg)

}


Output
Hello,
        How are you
        I am fine, thank you
        ........



Previous                                                 Next                                                 Home

No comments:

Post a Comment