Java tutorial
//package com.java2s; import java.util.*; public class Main { public static Map split(List list, String separator) { if (list == null) return null; Map map = new HashMap(); if (list == null || list.size() == 0) return map; for (Iterator i$ = list.iterator(); i$.hasNext();) { String item = (String) i$.next(); int index = item.indexOf(separator); if (index == -1) map.put(item, ""); else map.put(item.substring(0, index), item.substring(index + 1)); } return map; } }