redis_getrange()

Read(260) Label: key, string, substring,

Description:

Get a substring of the string stored at a key.

Syntax:

redis_getrange(con,key,start,end)

Note:

External library funcition. The length of the substring is determined by the two offset parameters start and end inclusive. Zero represents the first character of the string. A negative offset value counts from the end of the string. For instance, -1 represents the last character, -2 is the second-to-last character, and so on.

Parameters:

con

Database connection string

key

Key name

start

The beginning of the substring

end

The end of the substring

Return value:

A substring of the specified string

Example:

 

A

 

1

=redis("192.168.18.131:6379","runqian")

 

2

=redis_getrange(A1,"name",0,7)

3

=redis_getrange(A1,"name",-3,-1)

Related functions:

redis()