substr
此方法从特定字符串获取子字符串。
语法 (Syntax)
substr(string1,index,count)
参数 (Parameters)
string1 - 源字符串。
index - 子字符串的起始索引位置。
count - 子字符串的字符数。
返回值 (Return Value)
返回子字符串。
例子 (Example)
/* Main program */
a = "Hello World"
say substr(a,2,3)
当我们运行上述程序时,我们将得到以下结果。
输出 (Output)
ell