Home » Java Script » Get last 10 characters from a string using Java script

Get last 10 characters from a string using Java script

If you want to get last 10 or 5 or nth characters from a string using java script, this can be done very easily.substr function can be use to this.

Example:
My string is “http://www.mysite.com/blog/2012/09/”
I want to get 2012/09.This can be get like this.

Further you want to remove these Forwardslashes(/) this can be done like this.

More info Java script remove backslashes and forwardslashes from a string

Tags

Similar posts