Why is Swift String Manipulation like that
String Manipulation is notoriously tricky in Swift. Some common complaints:
- Three different datatypes: String, Substring, and Character.
- Cannot iterate String with Integer. We need to use a separate datatype called
String.Index.
So a simple palindrome search goes from this in Python:
To this in Swift: