Thursday, April 14, 2011

How to convert a string into string array in Javascript?

            var onestring = "a,b,c";

            var stringlist = points.split(",");
            var stringarray = new Array(stringlist.length);
            for (i = 0; i < stringlist.length; i++ ) {
                stringarray[i] = stringlist[i];
            }

No comments:

Post a Comment