Swift-Tips之重复字符串

1,701 阅读1分钟

method: init(repeating:count:)

let str = String(repeating: "测试", count: 10)
print(str)
//测试测试测试测试测试测试测试测试测试测试