Skip to content

Commit

Permalink
Reduces warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Caul58 committed Mar 29, 2024
1 parent d5a9319 commit 797cee5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Foundation

func isPalindrome(_ str: String) -> Bool {
// process given string
var processedString = str
let processedString = str
.lowercased()
.replacingOccurrences(of: " ", with: "")
.replacingOccurrences(of: ".", with: "")
Expand All @@ -38,7 +38,7 @@ func isPalindromeRegExp(_ str: String) -> Bool {
// process given string
let punctuationSearch = try! Regex("[^a-z0-9]")

var processedString = str
let processedString = str
.lowercased()
.folding(options: .diacriticInsensitive, locale: .current) // Removes acentuation
.replacing(punctuationSearch) { _ in "" } // Removes punctuation
Expand Down

0 comments on commit 797cee5

Please sign in to comment.