Is there an easy way to check if a longer string contains one of the defined parts of an enum using C#
For example I've got the following enum:
enum myEnum
{
this,
is,
an,
enum
};
and I have such a string:
string myString = "here I have a sample string containing an enum";
since the string is containing the keyword enum I'd like to find this within the string.
so I would need a function like string.contains(myString,myEnum). This function should then ruturn true or false.
Of course I could compare each value in the enum - but there might be an easier way...
How can I achieve this?