Function Kata „ToDictionary“
Implement a function that maps a special formatted string into a dictionary.
The function should have the following signature:
IDictionary<string, string> ToDictionary(string input);
The following table shows some examples for input strings and the resulting dictionary.
„a=1;b=2;c=3“ | {{„a“, „1“}, {„b“, „2“},{„c“, „3“}} |
„a=1;a=2“ | {{„a“, „2“}} |
„a=1;;b=2“ | {{„a“, „1“}, {„b“, „2“}} |
„a=“ | {{„a“, „“}} |
„=1“ | Exception |
„“ | {} |
„a==1“ | {{„a“, „=1“}} |
“I am the founder of Majer Consulting and Majer Training and an experienced software developer, trainer and consultant. I have been on the road in the SAP world since 1998, supporting numerous projects, and have developed a passion for software engineering, software testing and agile development methods such as TDD. When I am not servicing customers or holding seminars, I am speaking at conferences or writing my next book.”