Rexx - substr String



This method gets a sub string from a particular string.

Syntax

substr(string1,index,count) 

Parameters

  • string1 − The source string.

  • index − The starting index position for the sub string.

  • count − The number of characters for the sub string.

Return Value

Returns the sub-string.

Example

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

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

Output

ell 
rexx_strings.htm
Advertisements