I have an XmlElement. I am performing a string comparison on the text it contains. By all accounts, the comparison should pass. Until recently, the code has worked successfully. However, it is now failing.
// caller ....
processRow('my title', atag);
...
function processRow(title, rowtag) {
// rowtag.getText() returns the string 'my title'
if (rowtag.getText() == title) {
// ... this section is never entered
In debug mode, I see two identical String objects being compared. Am I doing something wrong?
It turns out an extra space was present in the xml contents. The difference was not reflected in the variable inspection window; however, the logger log presented the string correctly.