copies

优质
小牛编辑
128浏览
2023-12-01

此方法复制string n次。

语法 (Syntax)

copies(string1,count)

参数 (Parameters)

  • string1 - 源字符串。

  • count - 复制字符串的次数。

返回值 (Return Value)

返回字符串,复制计数次数。

例子 (Example)

/* Main program */ 
a = "Hello" 
say copies(a,3)

当我们运行上述程序时,我们将得到以下结果。

输出 (Output)

HelloHelloHello