How can I replace a backslash with a double backslash using RegExp?

前端 未结 2 1653
臣服心动
臣服心动 2020-12-16 02:25

I need to modify the value using javascript, to make it ready to be put as part of a SQL insert query.

Currently I have the following code to handle the single quot

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 02:57

    You should use a escape function provided by some kind of database library, rolling your own will only cause trouble.

提交回复
热议问题