Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (escape)
Viewing all articles
Browse latest Browse all 6

Difficulty in escaping single quote character while SQLite database insertion

$
0
0

I have to insert certain text in database which may contain characters with single quotes and double quotes.

For eg: "Lumix" or something like Vijay's

I have successfully escaped the double quotes like this:

if(fdata.search('"') != -1) {
 
 
fdata = fdata.replace(/(['"])/g, "\\$1");
 
 
 
}
But I am not understanding how to escape the single quotes. Without escaping the single quotes SQLite is not accepting the data. How to solve the issue? Thanks in advance!

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>