<script>
var a ="my name is joe";
var t = a.split(" "); //ถ้าเจอวรรคแตกเก็บลง array t
for(var i=0; i<t.length ; i++){
document.write(t[i]+"<br/>");
}
</script>
Date :
2009-11-14 13:06:23
By :
xbeginner01
No. 3
Guest
<script type="text/javascript">
var myString = "zero one two three four";
var mySplitResult = myString.split(" ");
for(i = 0; i < mySplitResult.length; i++){
document.write("<br /> Element " + i + " = " + mySplitResult[i]);
}
</script>