Convert HTML Entities not working

Convert HTML Entities not working
0

#1

so this passes all the test required… i plugged in all the quotes to make sure that it worked for every condition.

yet the test fails to detect the answers?


#2

If you by chance copied and pasted the replacement values from somewhere else instead of typing them out, you may have picked up some hidden characters which would foil the tests. Try manually retyping the replacement values and see if the solves your problem.

FYI - You do not need the if statements. You just need to use the code inside the code inside the { } of the if statements. Adding the if part using indexOf makes your code less efficient, because it first has to iterate through the string to see if the character exists and if so the replace iterates through the str to make all the replacements. Just doing the replace cuts out the extra iteration step.


#3

Super weird. that did solve the problem.


#4

Many campers have had this problem in the past 2-3 weeks. Where did you copy the values from? I am curious if everyone is getting these extra hidden characters from the same source.


#5

Thanks for the tip, I suppose I overthought the process of this algorithm. looking at other people’s answers, they seem to go overboard as well when its as simple as just having it replace without any other statements.

I copied it directly from


this list.