Possible Duplicate:
how to split a string in javascript
Please help me to substring and separate the below string in three variables using javascript.
var str="HH:MM:SS";
variable 1 is HH variable 2 is MM variable 3 is SS
Thanks
Possible Duplicate:
how to split a string in javascript
Please help me to substring and separate the below string in three variables using javascript.
var str="HH:MM:SS";
variable 1 is HH variable 2 is MM variable 3 is SS
Thanks
The simplest way is split
(specification | MDC):
var str = "HH:MM:SS";
var parts = str.split(":");
console.log(parts[0]); // "HH"
console.log(parts[1]); // "MM"
console.log(parts[2]); // "SS"