let myString = "This is a st ri ng" let trimmedString = myString.components(separatedBy: .whitespacesAndNewlines).joined()