mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
689def7325
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@571 0fc631ac-6414-0410-93d0-97cfa31319b6
21 lines
729 B
Plaintext
21 lines
729 B
Plaintext
Function: substring
|
|
|
|
--Usage--
|
|
> substring(some_string, begin: number, end: number)
|
|
|
|
Extract a subsection of a string.
|
|
|
|
--Parameters--
|
|
! Parameter Type Description
|
|
| @input@ [[type:string]] String to extract something from.
|
|
| @begin@ [[type:int]] (optional) Index of first character to keep (the first index is 0).
|
|
If ommitted, starts at the begining of the string.
|
|
| @end@ [[type:int]] (optional) Index just beyond the last character to keep.
|
|
If ommitted, runs to the end of the string.
|
|
|
|
--Examples--
|
|
> substring("abcdefg", end:2) == "ab"
|
|
> substring("abcdefg", begin:2) == "cdefg"
|
|
> substring("abcdefg", begin:2, end:4) == "cd"
|
|
> substring("abcdefg", begin:2, end:2) == ""
|