Statistical containing "a" containing a number or string of "A"

<! DOCTYPE HTML> 
<HTML lang = "EN">
<head>
<Meta charset = "UTF-. 8">
<title> characters containing A or a </ title>
</ head>
<body>
<Script>
/ / Title: count the number or a character string containing a-containing
// array with a script () or [] is defined.
the Array = new new char var ( "America", "Greece", "Britain", "Canada", "Chian", "Egypt");
var NUM = 0;
for (var I = 0; I <char.length; I ++ ) {
// the indexOf () method returns the index of the first occurrence of the specified string in a string, if not found return -1;
IF ((char [I] .indexOf ( "a" || "a") ) = -. 1) {!
NUM ++;
}
}
document.write (NUM);
</ Script>
</ body>

Guess you like

Origin www.cnblogs.com/taoist123/p/11124794.html