Java String Clean cleanStringByLikeWithHSQL(String input)

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

Description

clean String By Like With HSQL

License

Open Source License

Declaration

public static String cleanStringByLikeWithHSQL(String input) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static String cleanStringByLikeWithHSQL(String input) {
        if (input == null) {
            return "";
        }/*  www .j  a  v a 2  s  . c  o m*/
        input = input.replaceAll("\\\\", "\\\\\\\\\\\\\\\\");
        input = input.replaceAll("'", "''");
        input = input.replaceAll("%", "\\\\\\\\%");
        input = input.replaceAll("_", "\\\\\\\\_");

        return input;
    }
}

Related

  1. cleanString(String field)
  2. cleanString(String input, char ol, char ne)
  3. cleanString(String statement)
  4. cleanString(String unallowableCharacters, String stringToClean)
  5. cleanStringArrayChar(String value)
  6. cleanStringCamelCase(String in)
  7. cleanStringForFilename(String originalString)
  8. cleanStringForFilePath(final String dirty)
  9. cleanStringForJavaName(String original)