【问题标题】:SQLite: Escape quotes in Titanium (Javascript)SQLite:Titanium 中的转义引号(Javascript)
【发布时间】:2011-07-11 08:45:54
【问题描述】:

我使用 Titanium 作为开发工具,我想向 SQLite 数据库插入一个字符串。

字符串中包含双引号("),所以每次都会报错。​​

如何转义字符串中的引号,以便将字符串插入数据库?

提前致谢!

提勒克斯

【问题讨论】:

    标签: string mobile escaping titanium quotes


    【解决方案1】:

    你试过了吗

    db.execute("INSERT INTO schedule(NOTE) VALUES(?), "\" i am in quotes \"");
    

    【讨论】:

    • 我已经使用函数 Replace(\"\g,"\"\"") 完成了,现在可以使用了 感谢您的回复!
    【解决方案2】:

    您可能更喜欢 escape() 和 unescape() javascript 方法,它们更通用且更安全。 它就像 Titanium 的魅力一样。

    【讨论】:

      猜你喜欢
      • 2011-01-01
      • 2012-10-07
      • 2014-08-24
      • 2023-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-06
      相关资源
      最近更新 更多