Android examples for java.lang:StringBuilder
SQL build In Clause
public class Main{ public static String buildSqlInClause(String keyword, String value) { StringBuilder sb = new StringBuilder(); sb.append(" (").append(keyword).append(" is not null and ("); sb.append(keyword + "='" + value + "'"); sb.append(" or ").append(keyword + " like '%," + value + ",%'"); sb.append(" or ").append(keyword + " like '%," + value + "'"); sb.append(" or ").append(keyword + " like '" + value + ",%'"); sb.append(")) "); return sb.toString(); }// www . ja v a 2 s . c om }