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
Name | Type | Description |
s1 | String | A String to use as a source of the substring. |
beginIndex | int | The String index where the substring should start. |
endIndex | int | The String index where the substring should end. |
Returns
Type | Description |
String | A new string that is a substring of this string starting
at beginIndex and continuing to endIndex . |
Example
int result = String.substring("This is a test. This is a test.", 5, 9);
Result is: "is a"