Dictionary with delegate or switch?

后端 未结 6 1479
一生所求
一生所求 2021-02-07 01:21

I am writing a parser which calls some functions dependent on some value.

I can implement this logic with simple switch like this:

switch(some_val)            


        
6条回答
  •  没有蜡笔的小新
    2021-02-07 01:57

    If you need to switch on strings in a resource file, say for globalization purposes, then you'll need to use the dictionary/delegate approach.

提交回复
热议问题