SETRANGE

    Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value. If the offset is larger than the current length of the string at key, the string is padded with zero-bytes to make offset fit. Non-existing keys are considered as empty strings, so this command will make sure it holds a string large enough to be able to set value at offset.

    Integer reply: the length of the string after it was modified by the command.

    Basic usage:

    where stands for the NUL character, inserted by the zero padding.