clwn.net
当前位置:首页 >> list转为string >>

list转为string

假设你的list变量名是list StringBuffer sb=new StringBuffer(); for(String item:list){ sb.append(item); } // sb.toString() 就是你要的字符串; String[] arr=new String[list.size()]; for(int i=0;i

import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class StringTest { public static void main(String[] args) { ArrayList packagesArray = new ArrayList(); packagesArray.add("1"); packagesArray.add...

String abc = "aaa,bbb,ccc"; String[] arr = abc.split(","); List list = java.util.Arrays.aslist(abc);

假设你的list变量名是list StringBuffer sb=new StringBuffer(); for(String item:list){ sb.append(item); } // sb.toString() 就是你要的字符串; String[] arr=new String[list.size()]; for(int i=0;i

是把TStringlist转换成string类型吗? TStringList中存放的就是string, 比如 var StrLst:TStringList; str,tmp:string; begin StrLst.add(str); tmp := StrLst[0]; end; 实际就是tmp:=str;

List list = new ArrayList(); String[] strArr = new String[list.size()]; list.toArray(strArr);

string str = "AB,C,D"; var liststr = str.Split(','); List mylist=new List(); foreach(var item in listvar) { myList.add(item); } 别忘记采纳!

String abc = "aaa,bbb,ccc"; String[] arr = abc.split(","); List list = java.util.Arrays.aslist(abc);

List list = new ArrayList(); String[] strArr = new String[list.size()]; list.toArray(strArr);

ArrayList list = new ArrayList(Arrays.asList(array)); 方法二: public List getList(Object[] obj)throws Exception{ List list = new ArrayList(); for(int i=0;i

网站首页 | 网站地图
All rights reserved Powered by www.clwn.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com