strlen

Function strlen 

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

获取字符串长度

§功能

返回字符串的字符数(注意:多字节字符按字符数计算)。

§参数

  • string: String - 要测量的字符串

§返回值

Number - 字符串长度

§示例

Set text "Hello"
Set length StrLen(text)          # 5
Set chinese "你好"
Set length2 StrLen(chinese)      # 2