str . length ( ) function to count number of character in given string .
for ( var i = 0 ; i < str . length ; i ++ ) { var ch = str [ i ] ; if ( ( ch >= " " && ch <= " " ) || ( ch >= " " && ch <= " " ) ) {