25 lines
512 B
Java
25 lines
512 B
Java
package com.gh.common.util;
|
|
|
|
/**
|
|
* Created by khy on 2017/5/2.
|
|
*/
|
|
|
|
public class StringUtils {
|
|
|
|
public static String buildString(String... arrStr) {
|
|
int strCount = 0;
|
|
|
|
for (int i = 0; i < arrStr.length; ++i) {
|
|
strCount += arrStr[i] == null ? 0 : arrStr[i].length();
|
|
}
|
|
|
|
StringBuilder result = new StringBuilder(strCount);
|
|
|
|
for (int j = 0; j < arrStr.length; ++j) {
|
|
result.append(arrStr[j]);
|
|
}
|
|
|
|
return result.toString();
|
|
}
|
|
}
|