I’m surprised I’ve not run into this before but Javascript has two sub string methods.
[String].substr(start, length); [String].substring(indexA, indexB);
To clarify by example:
var name = "Greg's Blog"; alert(name.substr(7, 4)); // Blog alert(name.substring(7, 11)); // Blog
Minor but caught me out this afternoon.
TweetYou can skip to the end and leave a response. Pinging is currently not allowed.
comments
No comments for this post. Be the first to respond!