如何在android中的arraylist hashmap中用空更改重复值?

时间:2013-04-09 13:02:13

标签: android arraylist hashmap

我想在arraylist hashmap中用空更改重复值我们怎么能用空更改重复值你可以看到  我有TAG_ALPHAABET,我存储0到9和a到z我想用空更改重复值

try {
    JSONObject jobject = new JSONObject(data);
    JSONObject jdata = jobject.getJSONObject(TAG_DATA);
    JSONArray jbrands = jdata.getJSONArray(TAG_BRAND);

    for(int i = 0; i < jbrands.length(); i++)   {
        HashMap<String, String> map = new HashMap<String, String>();

        brandid = jbrands.getJSONObject(i).get(TAG_BRANDID).toString();
        brandname = jbrands.getJSONObject(i).get(TAG_BRANDNAME).toString();
        brandimage = jbrands.getJSONObject(i).get(TAG_BRANDIMAGE).toString();

        Character checkchar = brandname.charAt(0);
        Character checkcharcase Character.toUpperCase(checkchar);
        String convert = Character.toString(checkcharcase);
        map.put(TAG_ALPHABET,convert);
        map.put(TAG_BRANDID,brandid);
        map.put(TAG_BRANDNAME,brandname);
        map.put(TAG_BRANDIMAGE,brandimage);

        stellolist.add(map);
    }
}
catch (Exception e) {
    e.printStackTrace();
}

0 个答案:

没有答案