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

10 lines
195 B
Go

func isPalindrome(s string) bool {
runes := []rune(s)
numRunes := len(runes) - 1
for i := 0; i < len(runes)/2; i++ {
if runes[i] != runes[numRunes-i] {
return false
}
}
return true
}