def strTest(): name = "" for i in range(10): name += "hello" #print name def strTest2(): nameList = ["hello","hello","hello","hello","hello","hello","hello","he…
学习几个常用的String方法 1.concat /** * Concatenates the specified string to the end of this string. 连接指定的字符串到该字符串后面 */ public String concat(String str) { int otherLen = str.length(); if (otherLen == 0) { return this; } int len = value.length; //复制一个新的数组,长度为现…