• How to repeat a string in Swift 4

    How to repeat a string in Swift 4

    Ever wanted to repeat a string x number of times? There is a simple way to do it in Swift 4. Check it out: let numberOfRepeats = 3 String(repeating: “stringToRepeat”, count: numberOfRepeats) So the “stringToRepeat” will repeat numberOfRepeats times.