I need to use Substring in Javascript. But despite my searches, i have an error : substr seems to be unknown…
function confirm_ticket(idAgir,TempsEstime) {
var str = TempsEstime;
var strConcatenate = TempsEstime.substr(0, 2) + ":" + TempsEstime.substr(2, 2);
alert("confirmer le temps de maintenance de " + strConcatenate + " min pour le ticket " + idAgir);
}
Is there anything wrong in this ?
thanks in advance
I think you’re looking for substring()
http://www.w3schools.com/jsref/jsref_substring.asp