Split a string array and get token
<html>
<head>
<title>The Split Method</title>
</head>
<body>
<script type="text/javascript">
var inputString = 'a=A,b=B,c=C,c="D"';
var arrayTokens = inputString.split(',',3);
for (var i in arrayTokens) {
document.writeln(arrayTokens[i] + "<br />");
var newTokens = arrayTokens[i].split('=');
document.writeln(newTokens[1] + "<br />");
}
</script>
</body>
</html>
Related examples in the same category