I have dirty data. Sometimes it contains characters like this. I use this data to make queries like
WHERE a.address IN (\'mydatahere\')
For
May be this will help someone as it helped me.
public static String removeBadChars(String s) { if (s == null) return null; StringBuilder sb = new StringBuilder(); for(int i=0;i