📅  最后修改于: 2022-03-11 14:45:01.553000             🧑  作者: Mango
func main() {
var str string = "ABCDDBA"
data := false
for i := 0; i < len(str)/2; i++ {
if str[i] != str[len(str)-i-1] {
data = false
} else {
data = true
}
}
fmt.Println(data)
}