JSREF

JavaScript String substr()

Extract a substring from text: