package main
import "fmt"
func main() {
// 1、声明字符类型
var ch byte
ch = 97
fmt.Printf("ch=%c\n",ch)
// 字符大小写相差32
ch = ch - 32
fmt.Printf("ch=%c\n",ch)
ch = 'b'
fmt.Printf("ch=%c,ch=%d\n",ch,ch)
// 2、自动推导
ch1 := 'c'
fmt.Printf("ch1 type is %T,ch1=%c,ch1=%d\n",ch1,ch1,ch1)
// 3、声明字符串
var s string
s = "xiaobei"
fmt.Printf("s=%s\n",s)
s1 := "hello"
fmt.Printf("s type is %T,s1=%s\n",s1,s1)
// 4、字符与字符串的区别
// 字符用单引号,除了转义字符除外
// 字符串用双引号
}