1.StringUtils.join使用方法:
String result=StringUtils.join(arr,'','');如果arr=["1","2","3","A","B","C"];
那么result="1,2,3,A,B,C";
这个用在in查询的场合很好.
如果要颠倒过来,用String[] arr=result.split(",");就好了.
当然,String.split也是一个非常实用的函数.
2.MessageFormat.format使用方法:
String message = "Territory {0} has been transferred to Team {1}.";
Object[] params={"A1","B2"};
String transferMsg = MessageFormat.format(message,params);//Territory A1 has been transferred to Team B2.
这个函数用于预设空缺待填文本的场合很好.