色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

spring里面list怎么轉(zhuǎn)成string

spring里面list怎么轉(zhuǎn)成string?

應(yīng)該問的是java里面如果將list轉(zhuǎn)成string才對(duì)哦

方法1:

public String listToString(List list,

char separator) {

StringBuilder sb = new StringBuilder();

for (int i = 0; i < list.size(); i++) {

sb.append(list.get(i)).append(separator);

}

return sb.toString().substring(0,sb.toString().length()-1);

}

方法2:

public String listToString(List list, char separator) {

StringBuilder sb = new StringBuilder();

for (int i = 0; i < list.size(); i++) {

if (i == list.size() - 1) {

sb.append(list.get(i));

} else {

sb.append(list.get(i));

sb.append(separator);

}

}

return sb.toString();

java 取list值,spring里面list怎么轉(zhuǎn)成string