Function repeat
Source pub fn repeat(args: &[Value]) -> Result<Value, RuntimeError>
Expand description
重复字符串
将字符串重复指定的次数。
string: String - 要重复的字符串
count: Number - 重复次数(必须是非负整数)
§返回值
String - 重复后的字符串
Set str "Ha"
Set laugh Repeat(str, 3) # "HaHaHa"
Set dash "-"
Set line Repeat(dash, 10) # "----------"
Set space " "
Set indent Repeat(space, 4) # " "