Rexx - 字串位置



此方法返回一個字串在另一個字串中的位置。

語法

pos(substr,string1)

引數

  • string1 − 源字串。

  • substr − 在主字串中搜索的子字串。

返回值

此方法返回一個字串在另一個字串中的位置。

示例

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

執行以上程式後,將得到以下結果。

輸出

1 
rexx_numbers.htm
廣告

© . All rights reserved.