substr
Purpose
Synopsis
function substr(str:string, i1:integer, i2:integer):string
Arguments
|
str
|
String
|
|
i1
|
Starting position of the substring
|
|
i2
|
End position of the substring
|
Return value
Substring of the given string.
Example
write(substr("Example text", 3, 10))
This outputs the text:
ample te
Further information
This function returns the substring from the i1
th to the i2
th character of a given string (the counting starts from 1). This function returns an empty string if the bounds are not compatible with the string (
e.g. starting position larger than the length of the string) or inconsistent (
e.g. starting position after end position).
© 2001-2022 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation ("FICO"). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.
