lib/command/string.js
function getrange(key, start, end, req) {
  var val = this.getKey(key, req);
  if(!val) return '';
  start = parseInt(start);
  end = parseInt(end);
  if(start < 0) start = val.length + start;
  if(end < 0) end = val.length + end;
  // TODO: buffer compat
  return (val + '').substr(start, end + 1);
}
function getrange(key, start, end, req) {
  var val = this.getKey(key, req);
  if(!val) return '';
  start = parseInt(start);
  end = parseInt(end);
  if(start < 0) start = val.length + start;
  if(end < 0) end = val.length + end;
  // TODO: buffer compat
  return (val + '').substr(start, end + 1);
}
function getrange ( key , start , end , req ) { var val = this . getKey ( key , req ) ; if ( ! val ) return '' ; start = parseInt ( start ) ; end = parseInt ( end ) ; if ( start < 0 ) start = val . length + start ; if ( end < 0 ) end = val . length + end ; // TODO: buffer compat return ( val + '' ) . substr ( start , end + 1 ) ; }
Get a substring of the string stored at a key.
Get a substring of the string stored at a key .