JAVA字符串格式化-String.format()的使用
JAVA字符串格式化-String.format()的使用
public class Test08 {
public static void main(String[] args) {
StringBuilder builder = new StringBuilder("select * from %s::%s");
String tdwDB = "test";
String tdwTable = "user";
System.out.println( String.format(builder.toString(), tdwDB, tdwTable));
}
public static void main(String[] args){
final String TDW="abc_%s";
String s="def";
String tdwRtx = String.format(TDW, s);
System.out.println(tdwRtx);
}