*Redis substr 命令
*语法
SUBSTR key start end
返回 key 处存储的字符串值的子串,由偏移量 start 和 end 确定(两者都是包含的)。
可以使用负偏移量来提供从字符串末尾开始的偏移量。
所以 -1 表示最后一个字符,-2 表示倒数第二个,依此类推。
该函数通过将结果范围限制为字符串的实际长度来处理越界请求。
*示例
redis>
SET mykey "This is a string"
"OK"redis> GETRANGE mykey 0 3
"This"redis> GETRANGE mykey -3 -1
"ing"redis> GETRANGE mykey 0 -1
"This is a string"redis> GETRANGE mykey 10 100
"string"