Get last 10 characters from a string using Java script

0

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

Share.

About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.