blob: 2517b01bf50377e1f9118450dcfd4f5dedb8ba55 (
plain)
1
2
3
4
5
6
7
8
9
10
|
let str = "Perl Weekly Challenge";
let count = 0;
for(let i =0; i < str.length; i++){
if(str[i] === "e"){
count++;
str = str.replace("e", "E")
}
}
console.log(str)
console.log(count)
|