forked from solstice/solstice
718 B
718 B
string_Substring
Get a substring of a string.
Arguments
- str (string): the string to get a substring of.
- start (int): starting index of the substring.
- end (int): ending index of the substring.
Returns
substring (string): the substring of the given string.
Raises
AllocFail: raised if Ground failed to allocate memory for the new string.EndBeforeStart: raised if theendindex is less than thestartindex.OutOfBounds: raised if either theendorstartindex is outside the bounds of the string.
Example
Ground
call !string_Substring "Hello, World!" 1 3 &sub
println $sub # "ell"
Solstice
puts string_Substring("Hello, World!", 1, 3) // "ell"