Creates a new string representing the given string repeated the specified number of times.
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
Parameters
repeatedValue
The string to repeat.
count
The number of times to repeat
repeated
in the resulting string.Value
Discussion
For example, you can use this initializer to create a string with ten "ab"
strings in a row.