Skip to content
Reference > Methods

strSubstring(text,start,end)

Definition

String strSubstring(String text, Number start, Number end)

Description

Returns a substring from a string, based on the specified start and end. If start or charsToReplace extend beyond string length, they will be set to string length.

Parameter Definition

Name Type Description
text String The base string to get a substring from
start Number zero indexed start of substring to return
end Number zoro indexed end of substring to return

Examples

1
2
3
4
String r1 = strSubstring("this",1,2); // r1 == h
String r2 = strSubstring("this",0,4); // r2 == this
String r3 = strSubstring("this",2,100); // r3 == is
String r4 = strSubstring("this",-10,1); // r4 == t