Info |
---|
|
This routine is available starting with SIL Engine™ 1.0. Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | substring(str, start, stop) | Package | | Alias | | Pkg Usage | | |
Description
Excerpt |
---|
|
Returns substring is starting at index start and stop at index stop. |
Returns substring is starting at index start and stop at index stop. The substring returned has length stop - start. First position of character expression expression str is 0. If index start is not initialized or -1, it will be set on 0. If index stop is not initialized or -1, it will be set on end of the string.
Parameters
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
str | |
...
String | Yes | Specifies a character expression the character string is returned from. | start |
|
...
Number | Yes | Specifies the position in the character expression str the character string is returned from. | stop |
|
...
Number | Yes | Specifies the position in the character expression str the character string is returned from. |
|
Return
...
Type
stringString
...
Examples
Example 1
Code Block |
---|
number start;
number stop;
substring("FooBar", start, stop);
// start will default to 0
// stop will default to 6
// substring() will return FooBar
// Result are the same if we initialize start and/or stop with -1
|
Example 2
Code Block |
---|
number start;
number stop = 3;
substring("FooBar", start, stop);
// start will default to 0
// will return Foo
|
Example 3
Code Block |
---|
string v = "ABCDEFGHIJKLMNOP...";
print(substring(v, 0, 3)); //"ABC"
print (substring (v, 10, 100 )); //"KLMNOP..."
print(substring(v, 10, -1)); //"KLMNOP..." (same call)
|
...
Note |
---|
If stop is equal start or start is greater than the maximum length of character expression str, substring returns an empty string. |
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 10025 |
---|
showSpace | false |
---|
cql | label = "string_routines"routine" and space = currentSpace ( ) |
---|
labels | stringarray_routines |
---|
|