字符串
字符串基本用法
package main
import (
"fmt"
)
func main() {
var s string // empty string ""
s1 := "string\nliteral\nwith\tescape characters\n"
s2 := `raw string literal
which doesnt't recgonize escape characters like \n
`
fmt.Printf("sum of strings\n'%s'\n", s+s1+s2)
}sum of strings
'string
literal
with escape characters
raw string literal
which doesnt't recgonize escape characters like \n
'最后更新于