>
 





When you write JavaScript, you need to know what string manipulation methods/functions are available.

JavaScript substring() Method

substring is used to take a part of a string. The syntax of substring method is given below:

stringObjectToTakeAPartOf.substring(start-index,stop-index)

 

substring Example:

<script type="text/javascript">

var str = "Hello World";
document.write(str.substring(4,8));

</script>

The output of the above code is:

o wo

Want automatic updates? Subscribe to our RSS feed or
Get Email Updates sent directly to your inbox!

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories : All | JavaScript
Share & Support : del.icio.us | DZone it! | Kick it! | digg it! | Furl | Technorati


Comments

January 1. 2009 16:18

hi,

really nice article...informative for javascript...

web hosting plan | Reply

October 27. 2009 14:28

thanks!  very helpful post!! like the template btw ;)

cash loans | Reply

November 11. 2009 14:47

Thanks for sharing this information. I found it very informative as I have been researching a lot lately on practical matters such as you talk about.

oes tsetnoc | Reply

November 25. 2009 21:36

nice small info on the JavaScript substring Function.

oes tsetnoc | Reply

Add comment




(Will not be displayed!)








Free CMS