.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani
Sohaib Khalid

Home >> Code Snippets >> Javascript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

How To Use Split Function?

Posted By:Ghanashyam Nayak       Posted Date: August 10, 2010    Points: 10    Category: Javascript    URL: http://www.dotnetspark.com  

Using Scripting You Can Split Your String In Words By Giving Separator....

var str = "Hello How Are You";
var strarray = str.split(" ");

//Above Line Will Splits Words By Space As a Separator.....

//After That It Will Store All Words Which Are Splitted In The strarray Variable Which Is Array...

//You Can Retrieve Words Like :

var firstword = strArr[0];

//It Will Give You First Word & Like This Way You Can Get All Splitted Words


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend