Skip to main content

GETRANGE

Syntax

GETRANGE key start end

Module

string

Categories

read slow string

Description

Return the substring of the string value stored at key. The substring is specified by the start and end indexes.

Examples

Get the substring of a string value:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
substring, err := db.GetRange("key", 4, 10)