Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Dictionary<string, string> CreateDictionary(Dictionary<string, string> data, string key)
- {
- Dictionary<string, string> result = new Dictionary<string, string>();
- if (data != null && (!key.IsNullOrWhiteSpace()))
- {
- if (data.ContainsKey(key))
- {
- string value = data[key];
- if (value.StartsWith("#"))
- {
- string[] valueSplitted = value.Split(new char[] { ';' });
- if (valueSplitted.Length > 1)
- {
- string property = String.Empty;
- string dataArea = String.Empty;
- int positionFirstEqualSign = 0;
- for (int index = 1; index < valueSplitted.Length; index++)
- {
- positionFirstEqualSign = valueSplitted[index].IndexOf('=');
- if (positionFirstEqualSign > 0)
- {
- property = valueSplitted[index].Substring(0, positionFirstEqualSign);
- //falls sich im "Datenbereich" weitere '=' befinden
- dataArea = valueSplitted[index].Substring(positionFirstEqualSign + 1);
- result.Add(property, dataArea);
- }
- }
- }
- }
- }
- }
- return (result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement