about me about me
photography photography
software projects software projects
contact me contact me
25
Nov

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.


comments

No comments for this post.

this post's tags