字符串格式化输出
作者:互联网
public class Application { public static void main(String[] args) { String str = "ma qing song"; //split用于分分割字符串 String[] strsplit = str.split(" "); System.out.println(Arrays.toString(strsplit)); //format用于格式化输出 String format = String.format("%s, %s",strsplit[2],strsplit[1]); System.out.println(format); } }
标签:输出,格式化,String,format,System,split,strsplit,字符串,out 来源: https://www.cnblogs.com/maqingsong/p/16486170.html