标签:import -o split 图片 efi pack https shadow index
package main
import (
"fmt"
"strings"
)
func main() {
s := "hello world"
//是否包含
fmt.Println(strings.Contains(s, "hello"), strings.Contains(s, "?"))
//索引
fmt.Println(strings.Index(s, "o"))
ss := "1#2#345"
//分割字符串
splitedStr := strings.Split(ss, "#")
fmt.Println(splitedStr)
//合并字符串
fmt.Println(strings.Join(splitedStr, "#"))
//是否包含前缀,后缀
fmt.Println(strings.HasPrefix(s, "he"), strings.HasSuffix(s, "ld"))
}
输出:
标签:import -o split 图片 efi pack https shadow index
原文地址:https://blog.51cto.com/5660061/2361626