Replace ‘ with \’ in a string

You have to escape the “\”:

str.replace("'","\\'")

“\” is an escape sequence indicator, which, to be used as a normal char, has to be escaped (by) itself.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)