Lucene.Net.Spatial.Queries.SpatialArgsParser.ParseMap C# (CSharp) Method

ParseMap() protected static method

Parses "a=b c=d f" (whitespace separated) into name-value pairs. If there is no '=' as in 'f' above then it's short for f=f.
protected static ParseMap ( string body ) : string>.IDictionary
body string
return string>.IDictionary
        protected static IDictionary<string, string> ParseMap(string body)
        {
            var map = new Dictionary<string, string>();
            StringTokenizer st = new StringTokenizer(body, " \n\t");

            while (st.HasMoreTokens())
            {
                string a = st.NextToken();
                int idx = a.IndexOf('=');
                if (idx > 0)
                {
                    string k = a.Substring(0, idx - 0);
                    string v = a.Substring(idx + 1);
                    map[k] = v;
                }
                else
                {
                    map[a] = a;
                }
            }

            return map;
        }
    }