Rexx - pos String


Advertisements

This method returns the position of one string within another.

Syntax

pos(substr,string1)

Parameters

  • string1 − The source string.

  • substr − the sub string to search for in the main string.

Return Value

This method returns the position of one string within another.

Example

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

When we run the above program, we will get the following result.

Output

1 
rexx_numbers.htm
Advertisements