Siebel eScript Language Reference > Siebel eScript Commands > String Objects >

substring() Method


This method retrieves a section of a string.

Syntax

stringVar.substring(start[, end])

Parameter
Description
start
An integer specifying the location of the beginning of the substring to be returned
end
An integer one greater than the location of the last character of the substring to be returned

Returns

A new string, of length end - start, containing the characters that appeared in the positions from start to end - 1 of stringVar.

Usage

This method returns a portion of stringVar, comprising the characters in stringVar at the positions start through end - 1. The character at the end position is not included in the returned string. If the end parameter is not used, stringVar.substring() returns the characters from start to the end of stringVar.

Example

For an example, read indexOf() Method.

See Also

charAt() Method, indexOf() Method, and lastIndexOf() Method


 Siebel eScript Language Reference 
 Published: 18 April 2003