char_at

Function char_at 

Source
pub fn char_at(args: &[Value]) -> Result<Value, RuntimeError>
Expand description

获取指定位置的字符

§功能

获取字符串中指定索引位置的字符。

§参数

  • string: String - 原始字符串
  • index: Number - 字符位置(从0开始)

§返回值

String - 该位置的字符,索引越界返回空字符串

§示例

Set text "Hello"
Set ch CharAt(text, 0)           # "H"
Set ch2 CharAt(text, 4)          # "o"
Set ch3 CharAt(text, 10)         # ""