JavaScript – How to Print String Value One by One Using For Loop

javascript

This is my string "HelloHowAre" I want to print it like this – Hello How Are Using For loop

Best Answer

you can try with the below javascript code

var newvalll = 'HelloHowAre'.match(/[A-Z][a-z]+|[0-9]+/g);
   var res = String(newvalll);
   var nameArr = res.split(',');

for (var i = 0; i < nameArr.length; i++) {
     alert(nameArr[i]);
}

I think this is help to you

Related Topic