Rexx - substr() 方法

此方法从特定字符串中获取子字符串。

语法

substr(string1,index,count) 

参数

  • string1 − 源字符串。

  • index − 子字符串的起始索引位置。

  • count − 子字符串的字符数。

返回值

返回子字符串。

示例

/* 主程序 */
a = "Hello World" 
say substr(a,2,3) 

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

输出

ell 

❮ rexx_strings.html