title: Replacing double quote with single quote to store in SQLite
body: <p>I would like to replace all double quotes with single quotes in a string. I have tried using <code>stringByReplacingOccurrencesOfString</code> but it does not work. How do i make it replace all the double quotes with single quotes so that i can store it into the database?</p>
  
  <pre><code>sqlite3_stmt    *statement;
  
  NSString *string = [NSString stringWithString:charDesc.text];
  [string stringByReplacingOccurrencesOfString:@"\"" withString:@"''"];
  
  if(sqlite3_open([databasePath UTF8String], &amp;database) == SQLITE_OK){
      NSString *insertSQL = [NSString stringWithFormat: @"UPDATE CHARACTER SET charName = \"%@\", charDescription = \"%@\" WHERE charID = %i", charName.text, charDesc.text, charID];
  
      const char *insert_stmt = [insertSQL UTF8String];
  
      sqlite3_prepare_v2(database, insert_stmt, -1, &amp;statement, NULL);
      if (sqlite3_step(statement) == SQLITE_DONE){
          status.text = @"Succesfully Updated!";
      }else{
          status.text = @"Failed to Update!";
      }
  
      sqlite3_finalize(statement);
      sqlite3_close(database); 
  }
  </code></pre>