cut string in JavaScript using substr function
String : HH:MM:AMPM
syntex :
var cutstr = string.substr(startIndex , Length) ;
CODE :-
<script>
function cutstring(){
btime = 'HH:MM:AMPM ';
var hh = btime.substr(0,2);
var mm = btime.substr(3,2);
var ampm =btime.substr(6,2);
alert(hh);
alert(mm);
alert(ampm);
}
</script>
<b> String : HH:MM:AMPM </b>
<input type="button" onclick="cutstring()" name="button" value="click " />
syntex :
var cutstr = string.substr(startIndex , Length) ;
CODE :-
<script>
function cutstring(){
btime = 'HH:MM:AMPM ';
var hh = btime.substr(0,2);
var mm = btime.substr(3,2);
var ampm =btime.substr(6,2);
alert(hh);
alert(mm);
alert(ampm);
}
</script>
<b> String : HH:MM:AMPM </b>
<input type="button" onclick="cutstring()" name="button" value="click " />
Keeping your youngster healthy should be your main concern, so ensure that you purchase
ReplyDeleteonly quality baby care products. Other than this, proper baby medicines are widely-used to maintain the health
with the kids. Her chiropractor performed low
amplitude, high velocity manipulation along the 3 spinal locations and almost 1.