right

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

此方法从字符串的右侧返回一定数量的字符。

语法 (Syntax)

right(str,count) 

参数 (Parameters)

  • str - 源字符串。

  • count - 从字符串左侧返回的字符数。

返回值 (Return Value)

此方法从字符串的右侧返回一定数量的字符。

例子 (Example)

/* Main program */ 
a = "Hello World" 
say right(a,5)  

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

输出 (Output)

World