RosettaCodeData/Task/Palindrome-detection/Go/palindrome-detection-3.go
2016-12-05 22:15:40 +01:00

10 lines
188 B
Go

func isPalindrome(s string) bool {
runes := []rune(s)
for len(runes) > 1 {
if runes[0] != runes[len(runes)-1] {
return false
}
runes = runes[1 : len(runes)-1]
}
return true
}