

Īnd some other - substr() - which provide range of substring and 'length' can be positive only: string.substr(start,length)Īlso some maintainers suggest that last method string.substr(start,length) do not works or work with error for MSIE. so: string.substring(from) positive or negative. String.substring(from,to) as plus if 'to' index nulled returns the rest of string. Need to say due to last discussion in comments, that jQuery is very much more often renewable extension of JS than his own parent most known ECMAScript. However, your method will works out of jQuery function, inside simple Javascript. And you won’t need one or ever face a problem because there are so many ways in C to do what code slice/code does. In other words answer Erickson suggest really perfect solution. It accepts two arguments, the first argument is the element. So, you can't use slice() inside jQuery because slice() is jQuery method for operations with DOM elements, not substrings. The slice () method selects a given part of an array and returns that selected part as a new array without changing the original array. Sorry for my graphomany but post was tagged 'jquery' earlier. node.js arrays slice Share Follow asked at 5:32 user16041868.
