STRLEN
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
STRLEN keyThis command finds the length of the string value that is associated with the given key.
- If
keyis associated with a non-string value, an error is raised. - If
keydoes not exist, 0 is returned.
Return Value
Returns length of the specified string.
Examples
You can do this as shown below.
1. $ SET yugakey "string value"
1. "OK"
1. $ STRLEN yugakey
1. 12
1. $ STRLEN undefined_key
1. 0
