Function Kata "Count characters"
Develop a function that counts the number of characters in a string. The input of the function is a stringthe output of a dictionary of char to int:
IDictionary CountCharacters(string input)
The string "This must not be" returns the following result:
D:1, a:2, s:2, _:3, d:1, r:1, f:1, n:2, i:2, c:1, h:1, e:1, t:1
(The character "_" stands for a space.)
Variation #1
As a variation, upper and lower case letters can be treated equally. The string "This must not be" then provides the following result:
d:2, a:2, s:2, _:3, r:1, f:1, n:2, i:2, c:1, h:1, e:1, t:1