Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Now it doesn’t work if the string you want to replace has any regex special characters. One JS idiom for replace-all is

  str.split(before).join(after)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: