有一个装字符串的数组链表,怎样将他转化为一维数组,求解,有源码,跑的通,在线等待
3个回答
展开全部
List<String[]> list = new ArrayList<String[]>();
String temp = "kashfjkahsjkfhajskhf";
int count = temp.length();
for(int i = 0;i < count;i ++){
String[] s = new String[count];
s[i] = temp.substring(i,i+1);
list.add(s);
}
for (String[] strings : list) {
System.out.println(Arrays.toString(strings));
}
String temp = "kashfjkahsjkfhajskhf";
int count = temp.length();
for(int i = 0;i < count;i ++){
String[] s = new String[count];
s[i] = temp.substring(i,i+1);
list.add(s);
}
for (String[] strings : list) {
System.out.println(Arrays.toString(strings));
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询