{"id":562,"date":"2012-08-21T16:17:05","date_gmt":"2012-08-21T15:17:05","guid":{"rendered":"https:\/\/www.kolja-engelmann.de\/blog\/?p=562"},"modified":"2012-08-21T20:21:42","modified_gmt":"2012-08-21T19:21:42","slug":"konvertiere-enum-nach-string-und-umgekehrt","status":"publish","type":"post","link":"https:\/\/www.kolja-engelmann.de\/blog\/2012\/08\/konvertiere-enum-nach-string-und-umgekehrt\/","title":{"rendered":"C# &#8211; Konvertiere Enum nach String und umgekehrt"},"content":{"rendered":"<p>Kleine Gedankenst\u00fctze, weil ich es immer und immer wieder vergesse. (Peinlich, ich wei\u00df!)<\/p>\n<p>Zun\u00e4chst: Wie mache ich aus einem Enum einen String?<\/p>\n<pre class=\"lang:c# decode:true\">Enum.GetName( typeof(EnumType), EnumInstance);<\/pre>\n<p>Und wie wandle ich den String wieder zur\u00fcck in einen eine Instanz vom dazugeh\u00f6rigen Enum?<\/p>\n<pre class=\"lang:c# decode:true crayon-selected\">(EnumType)Enum.Parse(typeof(EnumType), \"&lt;Name eines Elements von EnumType&gt;\", true);<\/pre>\n<p>done;<\/p>","protected":false},"excerpt":{"rendered":"<p>Kleine Gedankenst\u00fctze, weil ich es immer und immer wieder vergesse. (Peinlich, ich wei\u00df!) Zun\u00e4chst: Wie mache ich aus einem Enum einen String? Enum.GetName( typeof(EnumType), EnumInstance); Und wie wandle ich den String wieder zur\u00fcck in einen&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":292,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[38],"tags":[39],"class_list":["post-562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-codeschnippsel","tag-c"],"jetpack_featured_media_url":"https:\/\/www.kolja-engelmann.de\/blog\/wp-content\/uploads\/2012\/06\/coding_php.jpg","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/posts\/562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/comments?post=562"}],"version-history":[{"count":0,"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/posts\/562\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/media\/292"}],"wp:attachment":[{"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/media?parent=562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/categories?post=562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolja-engelmann.de\/blog\/wp-json\/wp\/v2\/tags?post=562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}