node-js-libs / node.io

MIT License
1.81k stars 140 forks source link

Trouble replacing <br /> #139

Closed ttback closed 11 years ago

ttback commented 11 years ago

When I output result.fulltext, I have following in console.
Where: Blah blah blah
Event: Blah blah blah

But when i try to use str.replace('
', ""), nothing happens...I am a little confused, do you have experience with errors like this?

chriso commented 11 years ago

I can't help you without some sort of context here. result.fulltext returns a string, so replace should works as expected. Note that replace('<br />', '') will only replace the first occurrence. To replace all occurrences use replace(/<br \/>/g, '')

ttback commented 11 years ago

Exactly where I messed up, I forgot that in js, str.replace() is different from java, thank you!