标签:
// Hello project main.go
package main
import (
"fmt"
)
var str string
func miss(name string) {
fmt.Print(len(name))
}
func main() {
str = "ling nizai nali" //字符串赋值
ch := str[0] // 取字符串的第一个字符
fmt.Printf("The length of \"%s\" is %d \n", str, len(str))
fmt.Printf("The first character of \"%s\" is %c.\n", str, ch)
}
标签:
原文地址:http://www.cnblogs.com/missling/p/5354813.html