File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Cocoa
2
2
3
3
public func palindromeCheck ( text: String ? ) -> Bool {
4
4
if let text = text {
5
- let mutableText = text. trimmingCharacters ( in: NSCharacterSet . whitespaces ( ) )
5
+ let mutableText = text. trimmingCharacters ( in: NSCharacterSet . whitespaces ( ) ) . lowercased ( )
6
6
let length : Int = mutableText. characters. count
7
7
8
8
guard length >= 1 else {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Cocoa
2
2
3
3
public func palindromeCheck ( text: String ? ) -> Bool {
4
4
if let text = text {
5
- let mutableText = text. trimmingCharacters ( in: NSCharacterSet . whitespaces ( ) )
5
+ let mutableText = text. trimmingCharacters ( in: NSCharacterSet . whitespaces ( ) ) . lowercased ( )
6
6
let length : Int = mutableText. characters. count
7
7
8
8
guard length >= 1 else {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Here is a recursive implementation of this in Swift:
28
28
``` swift
29
29
func palindromeCheck (text : String ? ) -> Bool {
30
30
if let text = text {
31
- let mutableText = text.trimmingCharacters (in : NSCharacterSet.whitespaces ())
31
+ let mutableText = text.trimmingCharacters (in : NSCharacterSet.whitespaces ()). lowercased ()
32
32
let length: Int = mutableText.characters .count
33
33
34
34
guard length >= 1 else {
You can’t perform that action at this time.
0 commit comments