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
22
33public func palindromeCheck ( text: String ? ) -> Bool {
44 if let text = text {
5- let mutableText = text. trimmingCharacters ( in: NSCharacterSet . whitespaces ( ) )
5+ let mutableText = text. trimmingCharacters ( in: NSCharacterSet . whitespaces ( ) ) . lowercased ( )
66 let length : Int = mutableText. characters. count
77
88 guard length >= 1 else {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Cocoa
22
33public func palindromeCheck ( text: String ? ) -> Bool {
44 if let text = text {
5- let mutableText = text. trimmingCharacters ( in: NSCharacterSet . whitespaces ( ) )
5+ let mutableText = text. trimmingCharacters ( in: NSCharacterSet . whitespaces ( ) ) . lowercased ( )
66 let length : Int = mutableText. characters. count
77
88 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:
2828``` swift
2929func palindromeCheck (text : String ? ) -> Bool {
3030 if let text = text {
31- let mutableText = text.trimmingCharacters (in : NSCharacterSet.whitespaces ())
31+ let mutableText = text.trimmingCharacters (in : NSCharacterSet.whitespaces ()). lowercased ()
3232 let length: Int = mutableText.characters .count
3333
3434 guard length >= 1 else {
You can’t perform that action at this time.
0 commit comments