1、commons.lang3.StringUtils
public class T_StringUtils { public static void main(String []args ){ t_join(); } /**将数组以符号或其他字符串为间隔组成新的字符串*/ public static void t_join(){ String[] str = {"1","2","3","4"}; String result = StringUtils.join(str, "|"); System.out.println(result);//1|2|3|4 } }
时间: 2024-11-09 07:50:59