//字符串中是否存在 //指定的字符串 package main import ( "fmt" "strings" ) func main() { //创建和初始化字符串 str1 := "Welcome to Nhooo for Nhooo " str2 := "Here! we learn about go strings" //检查字符串是否存在 //使用Contains()函数 res1 := strings.Contains(str1, "Nhooo") res2 := strings.Contains(str2, "GFG") }