Showing posts with label Cross-broswer. Show all posts
Showing posts with label Cross-broswer. Show all posts

Thursday, December 5, 2013

Javascript - String functions



String.substr() VS String.substring() String.substr(start,length) is different from String.substring(start,end).
The second parameter length in substr() specify the number of character to be extracted,
whereas the second parameter end in substring() specify the index of ending character in the string.
Do not mess these two up. And pay attendion to the effect of negative number as second parameter giving to these functions.