久久久久久AV无码免费看大片,亚洲一区精品人人爽人人躁,国产成人片无码免费爱线观看,亚洲AV成人无码精品网站,为什么晚上搞的时候要盖被子

將JAVA 數(shù)組轉(zhuǎn)換成以某個字符分隔的字符串

時間:2020-01-03 22:37:56 類型:JAVA
字號:    

將JAVA 數(shù)組轉(zhuǎn)換成以某個字符分隔的字符串

package tool;
import java.io.UnsupportedEncodingException;
public class Common {
	public static String toUtf8(String value) throws UnsupportedEncodingException {
		String v = new String(value.getBytes("ISO-8859-1"),"UTF-8");
		return v;
	}
	public static String arrToStr(String[] str,String type) {
		String strs = "";
		for(String s : str) {
			strs += s + type;
		}
		strs = strs.substring(0,strs.length()-1);
		return strs;
	}
}


調(diào)用:
String[] hobby = request.getParameterValues("hobby");
String   hobbys = Common.arrToStr(hobby, "/");
out.println(Common.toUtf8(hobbys));

1.jpg

顯示結(jié)果如下:

2.jpg

<