You are viewing a single comment's thread. Return to all comments →
Extension for Swift to multiply Strings/Characters. Don't forget to unwrap the optional.
extension String { public init?(byRepeatingString str: String, count: Int) { var newString = "" for _ in 0 ..< count { newString += str } self.init(newString) } }
Sherlock and The Beast
You are viewing a single comment's thread. Return to all comments →
Extension for Swift to multiply Strings/Characters. Don't forget to unwrap the optional.