在 Go 中,你可以使用 ==
运算符来判断两个字符串是否完全匹配。例如:
s1 := "Hello, World"
s2 := "Hello, World"
if s1 == s2 {
fmt.Println("The strings are equal.")
} else {
fmt.Println("The strings are not equal.")
}
在 Go 中,你可以使用 ==
运算符来判断两个字符串是否完全匹配。例如:
s1 := "Hello, World"
s2 := "Hello, World"
if s1 == s2 {
fmt.Println("The strings are equal.")
} else {
fmt.Println("The strings are not equal.")
}