Discuss / Java / Stringbuilder 练习

Stringbuilder 练习

Topic source

陆佩廷

#1 Created at ... [Delete] [Delete and Lock User]

    static String buildInsertSql(String table, String[] fields) {

        // TODO:

        return "INSERT INTO table (fields) VALUES (?, ?, ?)".replace("table",table).replace("fields",String.join(", ",fields));

    }


  • 1

Reply