We have SET, APPEND, and SUBSTR. Considering the similarities between these, and the fact that APPEND can be done atomically, how about an atomic command for SUBSTR_REPLACE?
The format would be:
SUBSTR_REPLACE key start end replace
Interaction would be:
redis> set s "This is a string."
redis> substr s 0 3 "Rope"
"Rope is a string."
redis> substr s 0 -1 "New content."
The second scenario is an alias for set, and there are versions that would be an alias for prepend and append.
Is there anything to prevent this?
(I don't care what the command name would end up being, I just made something up.)