Description:
Get multiple substrings from a string to form a new string.
Syntax:
s.sbs(a:b,…)
Note:
The function gets multiple substrings from string s to form a new string.
Parameter:
s |
The source string from which substrings are to be obtained |
a |
The start position where substrings are obtained; default is 1 |
b |
The end position where getting substrings ends, whose defaut is s.len(); let b=a when :b is absent |
Return value:
String
Example:
|
A |
|
1 |
="abcdefgh".sbs(2:3) |
"bc" |
2 |
="abcdefgh".sbs(:3) |
"abc" |
3 |
="abcdefgh".sbs(3:) |
"cdefgh" |
4 |
="abcdefgh".sbs(3) |
"c" |
5 |
="abcdefgh".sbs(2:4,6:7) |
"bcdfg" |