Here you can find the source of sanitizeForSearch(String str)
public static String sanitizeForSearch(String str)
//package com.java2s; //License from project: Open Source License public class Main { /**//w w w.ja va 2 s . c om * Sanitize the string for searching. */ public static String sanitizeForSearch(String str) { if (str == null) { return null; } return str //general case for punctuation .replace("`", " ").replace("!", " ").replace("#", " ") .replace("$", " ").replace("%", " ").replace("^", " ") .replace("&", " ").replace("[", " ").replace("]", " ") .replace("{", " ").replace("}", " ").replace("|", " ") .replace(";", " ").replace("*", " ").replace(".", " ") .replace("?", " ").replace("'", " ").replace("/", " ") //to prevent injection .replace("=", " ").replace(":", " ").replace("<", "<") .replace(">", ">"); } }