SETRANGE
Syntax
SETRANGE key offset value
Module
stringCategories
write slow stringDescription
Overwrites part of a string value with another by offset. Creates the key if it doesn't exist.
Examples
- Go (Embedded)
- CLI
Overwrite part of a string value:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
length, err := db.SetRange("key", 2, "replacement string")
Overwrite part of a string value:
> SETRANGE key 2 "replacement string"