| Author: Rajesh(March-2008 Winner) 30 Aug 2008 | Member Level: Gold | Rating: Points: 5 |
The split() method is used to split a string into an array of strings. Syntax
stringObject.split(separator, howmany)
Parameter Description separator Required. Specifies the character, regular expression, or substring that is used to determine where to split the string howmany Optional. Specify how many times split should occur. Must be a numeric value
<script type="text/javascript">
var str="afdsg fgfg";
document.write(str.split(" ") + "<br />"); document.write(str.split("") + "<br />"); document.write(str.split(" ",3));
</script>
|