Function substr
Source pub fn substr(args: &[Value]) -> Result<Value, RuntimeError>
Expand description
字符串切片
提取字符串的子串(基于字节索引)。
string: String - 原始字符串
start: Number - 起始索引(包含,从0开始)
end: Number - 结束索引(不包含)
§返回值
String - 提取的子串
Set text "Hello World"
Set sub StrSlice(text, 0, 5) # "Hello"
Set sub2 StrSlice(text, 6, 11) # "World"
Set sub3 StrSlice(text, 0, 1) # "H"