Android SqliteDatabase Command SQLiteSanitize(String input)

Here you can find the source of SQLiteSanitize(String input)

Description

Replaces SINGLE_QUOTEs with double SINGLE_QUOTEs

Parameter

Parameter Description
input string to sanitize

Return

sanitized value

Declaration

public static String SQLiteSanitize(String input) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w  w w  . j a v a 2  s  .c  o m*/
     * Replaces SINGLE_QUOTEs with double SINGLE_QUOTEs
     * 
     * @param input
     *            string to sanitize
     * @return sanitized value
     */
    public static String SQLiteSanitize(String input) {
        return input.replaceAll("'", "''").trim();
    }
}

Related

  1. getListOfDays(SQLiteDatabase db)
  2. insertIntoTable(SQLiteDatabase database, String table, String[] data)
  3. selectFromTable(SQLiteDatabase db, String table, String sample)
  4. updateTable(SQLiteDatabase database, String table, String id, String[] newValues)
  5. getTaskCursor(SQLiteDatabase database, String name)
  6. getFreeTourName(SQLiteDatabase db, String tourName)
  7. getNewTourPointPosition(SQLiteDatabase db, long tourId)
  8. getTourNames(SQLiteDatabase db)
  9. insertTour(SQLiteDatabase db, String tourName)