Why is Swift String Manipulation like that