本文内容
返回输入字符串的长度(以字符为单位)。
备注
此函数对 Unicode 码位元素进行计数。
strlen(
源)
详细了解语法约定。
客户 | 类型 | 必需 | 说明 |
---|---|---|---|
source | string |
✔️ | 要返回其长度的字符串。 |
返回输入字符串的长度(以字符为单位)。
print length = strlen("hello")
输出
length |
---|
5 |
print length = strlen("⒦⒰⒮⒯⒪")
输出
length |
---|
5 |
print strlen('Çedilla') // the first character is a grapheme cluster
// that requires 2 code points to represent
输出
length |
---|
8 |