pub fn split(args: &[Value]) -> Result<Value, RuntimeError>Expand description
分割字符串
§功能
使用指定的分隔符将字符串分割成数组。
§参数
string: String - 要分割的字符串separator: String - 分隔符
§返回值
Array - 包含分割后的子字符串的数组
§示例
Set text "apple,banana,cherry"
Set fruits Split(text, ",") # ["apple", "banana", "cherry"]
Set sentence "Hello World"
Set words Split(sentence, " ") # ["Hello", "World"]
Set csv "a|b|c|d"
Set parts Split(csv, "|") # ["a", "b", "c", "d"]