X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/46b614edf7522e2bf8d3512fab347a9c9d4a1d70..d021221086c9a6c5af404f3017791605b70c592d:/doc/SubstrCommand.html diff --git a/doc/SubstrCommand.html b/doc/SubstrCommand.html index 3b6bdef0..b5f4f792 100644 --- a/doc/SubstrCommand.html +++ b/doc/SubstrCommand.html @@ -16,7 +16,7 @@
-SubstrCommand: Contents
  SUBSTR _key_ _start_ _end_
    Return value
    Examples +SubstrCommand: Contents
  SUBSTR _key_ _start_ _end_
  GETRANGE _key_ _start_ _end_
    Return value
    Examples

SubstrCommand

@@ -27,7 +27,8 @@
#sidebar StringCommandsSidebar

SUBSTR _key_ _start_ _end_

-Time complexity: O(start+n) (with start being the start index and n the total length of the requested range). Note that the lookup part of this command is O(1) so for small strings this is actually an O(1) command.
Return a subset of the string from offset start to offset end(both offsets are inclusive).Negative offsets can be used in order to provide an offset starting fromthe end of the string. So -1 means the last char, -2 the penultimate andso forth.
+

GETRANGE _key_ _start_ _end_

+Time complexity: O(start+n) (with start being the start index and n the total length of the requested range). Note that the lookup part of this command is O(1) so for small strings this is actually an O(1) command.Warning: this command was renamed into GETRANGE. SUBSTR will be taken as an alias until the next major release of Redis.

Return a subset of the string from offset start to offset end(both offsets are inclusive).Negative offsets can be used in order to provide an offset starting fromthe end of the string. So -1 means the last char, -2 the penultimate andso forth.
The function handles out of range requests without raising an error, butjust limiting the resulting range to the actual length of the string.

Return value

Bulk reply

Examples

 redis> set s "This is a string"