[英]How to escape double quotes in Node.js
我已經嘗試過/來對字符串中的雙引號進行轉義,但是我無法獲得所需的字符串。
代碼片段在Node.js中如下
var queryString = "select * from courier where couriername LIKE '%"+filterName+"%'";
console.log(querystring);
我得到的輸出就像控制台上包含雙引號一樣:
select * from courier where couriername LIKE '%"a"%'
但是我想要這樣的輸出
select * from courier where couriername LIKE '%a%';
如何獲得..我嘗試了很多事情...
在我看來filterName等於“ a”而不是a
您可以記錄其價值嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.