-2

Bumping into an issue when inserting data to SQLite. In SQLite we have to write two single quote(') when we want to add a value containing ('). How to escape special characters like ' in sqlite in android


Question

How to replace all (') in string to ('')?

My bro's watch is 8 o'clock ==> My bro''s watch is 8 o''clock

It's better if the answer is written in Swift. Thank you!

YH_WU
  • 73
  • 11

1 Answers1

2

Just use replace all method just before adding in to sqlite.

Pawan kumar sharma
  • 654
  • 1
  • 7
  • 21