Here you can find the source of parsePropertiesString(String s)
Parameter | Description |
---|---|
s | Semi-colon delimited name=value string |
public static Hashtable parsePropertiesString(String s)
//package com.java2s; import java.util.*; public class Main { /**/*from ww w .j a v a2s.c om*/ * Parse the semi-colon delimited string of name=value properties. * * @param s Semi-colon delimited name=value string * @return properties */ public static Hashtable parsePropertiesString(String s) { Hashtable properties = new Hashtable(); if (s != null) { StringTokenizer tok = new StringTokenizer(s, ";"); while (tok.hasMoreTokens()) { String nameValue = tok.nextToken(); int idx = nameValue.indexOf("="); if (idx < 0) { continue; } properties.put(nameValue.substring(0, idx).trim(), nameValue.substring(idx + 1)); } } return properties; } }