Better use HashTable or switch case
问题 I'm not sure which one is better. I need to parse each character of an input string and get a replacing string for the character. For some objects all alphanumeric characters are allowed so using switch/case will cause a lot of code and reduce readability and maintainability but I can use a static method. Using a HashTable also requires a lot of code Using the static method: private static string EncodeChar(char c) { var symbols = string.Empty; switch (c) { case '0': symbols = "Test"; break;