I used sqlite database to save my data. I backuped sqlite table to a txt file. When I try to restore from txt to sqlite I get syntax error (code-1) . Because I used cutout sign ( ' )
for example when I writing (Türk'ler geldi).
Error is : android.database.sqlite.SQLiteException: near "ler": syntax error (code 1): , while compiling: .......
How can I insert it. I used ( \' )
but it didn't work.
Here is my code from sqlite to txt file
semptoms = db.allSemptom();
int say = semptoms.size();
StringBuilder message = new StringBuilder("");
for (int i = 0; i < say; i++) {
Semptom semptom = semptoms.get(i);
String name = semptom.getName();
message.append(name + "\n");
}
saveToSymptom(message.toString());
I try to add .replace(" ' "," \ ' ")
but didn't work
I mean like this
message.append(name.replace(" ' "," \ ' ") + "\n")