将字符串重复count次。
Example
str.repeat('foo') // ''
str.repeat('foo', 3) // 'foofoofoo'
str.repeat('foo', '3', 'bar') // 'foobarfoobarfoo'
str.repeat(123, 2, '*') // '123*123'
str.repeat(123, 2, 4) // '1234123'
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
str |
String | 需要重复的字符串 | ||
count |
Number |
<optional> |
0
|
重复次数 |
separator |
String |
<optional> |
''
|
分隔符 |
Returns:
已重复了的字符串
- Type
- String