Posts by iago miranda • 31 points
1 post
-
3
votes2
answers1288
viewsQ: Replace last occurrence of "a" in a string
How do I replace the last occurrence of a in a string? var myFrase = prompt(" Digite sua frase aqui: "); for (i = 0; i < myFrase.length; i++) { result = myFrase.charAt(i); if (result == "a") {…