Rexx - 字符串子串



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

语法

substr(string1,index,count) 

参数

  • string1 − 源字符串。

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

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

返回值

返回子字符串。

示例

/* Main program */ 
a = "Hello World" 
say substr(a,2,3) 

运行以上程序后,将得到以下结果。

输出

ell 
rexx_strings.htm
广告
© . All rights reserved.