torno torno - 1 year ago 81
C# Question

Parsing FQN of enum constant to enum constant w/o splitting the string

Trying to parse an commandline argument ( 'MyNameSpace.MyEnumClassName.MyConstantName') in order to get the constant.

Is this possible without extracting the EnumClassName? I know that I could get the constant with


But is there a direct way?

This argument can be used for different things. There can be a fqn of a class, a constant, ... I know it's not kind of 'clean', but that`s not part of this question.

Answer Source

As there seems to be no direct way, I close this question with the answer "no".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download