Skip to content
Discussion options

You must be logged in to vote

The best way to do this right now would be to call a method

string ConvertStr(string s) => s[..s.IndexOf('x')];

var result = type switch {
   Enum.TypeString => ConvertStr(value.ToString()),
   _ => null
}

So this is achievable right now. But I still want to leave the discussion open

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Khaos66
Comment options

Comment options

You must be logged in to vote
1 reply
@YairHalberstadt
Comment options

Answer selected by Khaos66
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Khaos66
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants