String.substring()

Signature

String substring (String s1, int beginIndex, int endIndex)

Domain

ACTION, CONDITION, QUERY, BUI

Description

Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex - beginIndex.

Parameters

NameTypeDescription
s1StringA String to use as a source of the substring.
beginIndexintThe String index where the substring should start.
endIndexintThe String index where the substring should end.

Returns

TypeDescription
StringA new string that is a substring of this string starting at beginIndex and continuing to endIndex.

Cautions

none

Example

int result = String.substring("This is a test. This is a test.", 5, 9);

Result is: "is a"