H I O X INDIA
Javascript Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java-Script Tutorial
Introduction
Variables
Operators
Statements
Loops
Functions
Objects
Arrays
Browser Objects
Form DOM
Ask Your Doubts
Feedback





String Function - split()


Topic

how to split or concatenate a string in javascript?



Explanation

Object: String

Method or Function: split(string)

Description: It takes one argument called as delimiter. The argument is used to split the string in to an array of string. Every part that comes in between the delimiter is separated as a string. A delimiter can be any string or a character or even blank space.


Example Code:
<script language=javascript>
var ss = "testing-delimiter-split-function";
var result = ss.split("-");
document.write(result);
</script>

Result:

Explanation:
In the above example,
  • the main string is stored in a variable ss.
  • the method split takes the one argument, here it is "-".
  • the delimiter character "-" is used to split or concatenate the string.
  • any thing that comes in between the delimiter ("-") is separated in to a new string.
  • the result variable is an array of string.



  •         Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

    others

    privacy policy     license     sitemap
    © 2004-2005 HIOX INDIA - hioxindia.com

    Other Links