欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

格式化平行列的字符串,格式化行列字符串,for(i = 0; i

来源: javaer 分享于  点击 33714 次 点评:105

格式化平行列的字符串,格式化行列字符串,for(i = 0; i


for(i = 0; i < lastName.length; i++){       chars[i] = (firstName[i] + lastName[i]).length();       chars[i] = 17 - chars[i];//use larger number if strings are bigger       spaces[i] = "";       while (chars[i]>0){           chars[i]--;           spaces[i] += " ";       }newArray[i] = lastName[i] + ", " + firstName[i] + spaces;/** Nick Stanish* newArray[i] is the formatted column, if the arrays are confusing* then replace with a single string for easer readability*/}//displaySystem.out.println(newArray[0] + "other string");
相关栏目:

用户点评