1. Substr(str string, start int, length int) string

a := "abcde"
b := Substr(a, 1, 2) 
fmt.Println(b)

// bc

2.[:]

a := "abcde"
b := a[1:3]
fmt.Println(b)

// bc

标签: none

添加新评论