Created
July 19, 2016 01:31
-
-
Save z2015/27800dc901f55954f6aef7a942e3806e to your computer and use it in GitHub Desktop.
Substr vs Substring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var status = '.status-0' | |
console.log(status.substr(2,2)); //first param by begin, second by cut length, got 'ta' | |
console.log($(this).attr('data-filter').substring(2,4)); // first param by begin index, second by sub index string. got 'ta' also . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment