Skip to content

Instantly share code, notes, and snippets.

@marlonjames71
Last active March 7, 2021 01:00
Show Gist options
  • Save marlonjames71/876a8f454ce9309c70897d295d5643be to your computer and use it in GitHub Desktop.
Save marlonjames71/876a8f454ce9309c70897d295d5643be to your computer and use it in GitHub Desktop.
iOSCodeChallenge-04-01.md - PalindromeChecker function
func isPalindrome(strToCheck: String) -> Bool {
let formattedStr = strToCheck.lowercased().replacingOccurrences(of: " ", with: "")
let reversed = String(formattedStr.reversed())
return reversed == formattedStr
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment