【发布时间】:2013-07-07 10:27:51
【问题描述】:
我是编码新手,我正在使用字符串数组
String[] barcodedep= new String[100];
我想使用数组根据索引检索特定数据并在特定数组中找到它的重复项...
我正在使用这个存储,
ArrayList<HashMap<String, String>> contactList = new ArrayList<HashMap<String, String>>();
try{
len2++;
barcodedep[s2] = c.getString(TAG_BARCODE);
}
s2++;
for(int temp=0;temp<=len2;temp++){
HashMap<String, String> map = new HashMap<String, String>();
// adding each child node to HashMap key => value
map.put(TAG_BARCODE, barcodedep[temp]);
contactList.add(map);
}catch (JSONException e) {
e.printStackTrace();
}
我在查找该数组中已经存在的字符串时遇到问题,然后我想将编辑后的字符串发送回特定位置...
【问题讨论】:
-
“特定数组”是您已经拥有的另一个数组吗?
-
对于固定长度的纯数组是最好的选择
-
明确是要在同一个数组中查找重复元素还是要与第二个现有数组进行比较
-
@HussainAkhtarWahid 我想找到重复的......
-
该代码无法编译以 :(
标签: java android arrays indexing