last 2 lectures of section 12
last 2 lectures of section 12
This commit is contained in:
19
Section12/96.go
Normal file
19
Section12/96.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s1 := "I love Golang!"
|
||||
fmt.Println(s1[2:5])
|
||||
|
||||
s2 := "我爱戈兰"
|
||||
fmt.Println(s2[0:2])
|
||||
|
||||
rs := []rune(s2)
|
||||
fmt.Printf("%T\n", rs)
|
||||
|
||||
fmt.Println(string(rs[0:3]))
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user