Redis Getrange 命令

Redis 教程 · 2019-03-06 22:12:02

Redis Getrange 命令用于获取存储在指定 key 中字符串的子字符串。字符串的截取范围由 start 和 end 两个偏移量决定(包括 start 和 end 在内)。

语法

redis Getrange 命令基本语法如下:

redis 127.0.0.1:6379> GETRANGE KEY_NAME start end

可用版本

>= 2.4.0

返回值

截取得到的子字符串。

实例

首先,设置 mykey 的值并截取字符串。

redis 127.0.0.1:6379> SET mykey "This is my test key"
OK
redis 127.0.0.1:6379> GETRANGE mykey 0 3
"This"
redis 127.0.0.1:6379> GETRANGE mykey 0 -1
"This is my test key"

点击查看所有 Redis 教程 文章: https://codercto.com/courses/l/33.html

查看所有标签

Ajax for Web Application Developers

Ajax for Web Application Developers

Kris Hadlock / Sams / 2006-10-30 / GBP 32.99

Book Description Reusable components and patterns for Ajax-driven applications Ajax is one of the latest and greatest ways to improve users’ online experience and create new and innovative web f......一起来看看 《Ajax for Web Application Developers》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

URL 编码/解码
URL 编码/解码

URL 编码/解码

MD5 加密
MD5 加密

MD5 加密工具