lq-util v0.0.9
获取字符串字节长度
-
str
(string): 需要获取字节数的字符串
(number): 返回字符串字节长度
getByteLength('hello world')
// => 11
getByteLength('你好')
// => 4
getByteLength(' ')
// => 2
getByteLength('你好 world')
// => 10
getByteLength({})
// -1
getByteLength(9527)
// -1