This is an odd one.
I have a list item, containing the text '13 May 2011'. I have a lot of these dates, and I want to use JQuery to search them by a free text input (they're not always dates), but I can't seem to search for anything if I put a space in the search box.
However,
li.text() // 13 May 2011
li.text().indexOf('13') // 0
li.text().indexOf('13 ') // -1
li.text().indexOf(' ') // -1
'13 May 2011'.indexOf('13') // 0
'13 May 2011'.indexOf('13 ') // 0
li.text() == '13 May 2011' // false
I've pasted my return text into a text-to-hex converter, and the space character is a '20' (32 in decimal, which is a space in ASCII), so it's not a funny space character.
Has anyone encountered this problem before? Does anyone have any other ideas?
"13 May 2011", 0, 0, 2, 0, 0, true. You can see it here.13 May 2011 0 0 2 0 0 true