STRLEN
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
STRLEN key
This command finds the length of the string value that is associated with the given key
.
- If
key
is associated with a non-string value, an error is raised. - If
key
does not exist, 0 is returned.
Return Value
Returns length of the specified string.
Examples
You can do this as shown below.
$ SET yugakey "string value"
"OK"
$ STRLEN yugakey
12
$ STRLEN undefined_key
0
See Also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .