(text string)
| 17 | ) |
| 18 | |
| 19 | func cleanString(text string) string { |
| 20 | clean_text := strings.ToLower(text) |
| 21 | clean_text = strings.Join(strings.Fields(clean_text), "") // Remove spaces |
| 22 | regex, _ := regexp.Compile(`[^\p{L}\p{N} ]+`) // Regular expression for alphanumeric only characters |
| 23 | return regex.ReplaceAllString(clean_text, "") |
| 24 | } |
| 25 | |
| 26 | func IsPalindrome(text string) bool { |
| 27 | clean_text := cleanString(text) |
no outgoing calls
no test coverage detected