index = 0;
string1 = '1,2,3,4,5,6,8,9,0#';
string2 = '1,2,3#';
do{
document.write(string1.charAt(index));
index++;
}
while(string1.charAt(index) != '#');
index = 0;
document.write('<br />');
do{
document.write(string2.charAt(index));
index++;
}
while(string2.charAt(index) != '#');
Hello there, i am stuck at a Javascript assignment and i need to show the strings above in a do-while loop and i have to use charAt to do so. and i need the loop to stop at the # sign. But the charAt method only showed one number,
so my qeustion is: how can i show all the numbers with charAt? and how can i stop my do-while loop when the # sign is equal to the # sign