Monday, 6 February 2017

Javascript function to read the each characters in a string

This is simple method to traverse a string char by char using JavaScript. Here using charAt() built in function to process each letter of text.
<!DOCTYPE html>
function myFunction(){
var str = "abcd";
var len = str.length;
var str2 = str.charAt(i);
<button onclick="myFunction()">Click Here</button>

Try Output Here :

No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2016