取出List<String>中的数据加到StringBuffer中去

xiaoxiao2021-02-28  10

1、取出List<String>中的部分参数拼接到StringBuffer中

public void teachInfo(){ List<String> list = new ArrayList<>(); list.add("小学六年级年级placeId六年级(一)班Y语文@f9d883c80d7440d28d8d4c896a46a86a@a1a79888e5444565838c3ef57cc413b9@8152aba24b8f4f65b2165d999a3ed84d@13a49f51bdbc4c4aa811938cc1125d3e@Y@6a3387092fad4540b05114e2a45dc80b"); list.add("小学四年级年级placeId四年级(二)班N数学@f9d883c80d7440d28d8d4c896a46a86a@72e9d1040e1245a689454eb1de1d2af4@c10a9dc4bbdd4d19826d81bb570c8446@b053440406ef48b4a1089c64f073c193@N@382c748435cf4600a3871f9b4bab84cf"); list.add("小学四年级年级placeId四年级(十五)班N化学@f9d883c80d7440d28d8d4c896a46a86a@72e9d1040e1245a689454eb1de1d2af4@c10a9dc4bbdd4d19826d81bb570c8446@7e751c132b1c4af5bf464c1a8e4804a2@N@f1d44be35d19494ea2b6b2cc84721964"); StringBuffer xx = new StringBuffer() ; for(int i = 0;i < list.size();i++){ String s1 = (String) list.get(i); String[] array = s1.split("@"); xx.append(array[2] + "@" + array[4] + "@" + array[6] + ","); } }

转载请注明原文地址: https://www.6miu.com/read-450233.html

最新回复(0)