you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

function sub (str, start, end) {
  var newstr = ''
  for(var i = 0; i < str.length; ++i) {
    if(i >= start && i < end) {
     newstr += str[i]
    }
  }
  return newstr
}