STRLEN

Syntax
STRLEN key
Available since:
2.2.0
Time complexity:
O(1)
ACL categories:
@read, @string, @fast,

返回存储在key中的字符串值的长度。 当key包含非字符串值时,将返回错误。

示例

SET mykey "Hello world" STRLEN mykey STRLEN nonexisting

RESP2/RESP3 回复

Integer reply: the length of the string stored at key, or 0 when the key does not exist.
RATE THIS PAGE
Back to top ↑