forum

home / developersection / forums / assigning enum in c# with a string

Assigning enum in c# with a string

Anonymous User 2303 23-Dec-2013

I was wondering if there's an option to sign an enum with the options of white black and red, directly with a string "red". without using if's... I mean i don't want to write:

if (string1=="red") {mycolor=Color.red};

thanks!


c# c# 
Updated on 23-Dec-2013

I am a content writter !

Can you answer this question?

Answer

1 Answers

Liked By