Hello, everyone.
A co-worker asked for a second set of eyes regarding an issue he was having. Pulling text from a database, said text was put in a loop with several replaceNoCase() statements, then displayed as an attribute of an anchor tag; so, obviously, one of the replacements is the double quote. Every version of the double quote that we could think of was part of the loop, so it was looking for the standard quote, MS smart quotes, etc., and even included chr(34), all to be replaced with ".
Except for some strange reason, every other replace was working, but the " was still appearing and breaking the anchor attributes.
After a while of trying to understand what was happening, my co-worker (as a test) set the last line of the loop giving the variable an incremented name (ie, "thisVar" became "thisVar1") and replaced chr(34) with " and then output the new variable name. Voila. The replacement worked.
What happened? Why was every other replace working? And why did it work when the variable was renamed??
Scratchin' my head on this one.
Thank you,
^_^