Skip to main content

๐Ÿ‘ฉโ€๐Ÿ’ป string to enum

ๆˆ‘ๅ€‘ๅœจๆŸไบ›ๆƒ…ๅขƒไธ‹ๆœƒๆ‡‰็”จๅˆฐๅฐ‡ๅญ—ไธฒ่ฝ‰็‚บๅˆ—่ˆ‰โ€‹

ๅพžๅฎขๆˆถ็ซฏๅ‚ณๅ…ฅไธ€ๅ€‹ๅญ—ไธฒ๏ผŒๆˆ‘ๆƒณๅฐ‡ๅฎƒ่ฝ‰ๆ›็‚บๆˆ‘่‡ชๅฎš็พฉ็š„ๅˆ—่ˆ‰

    StatusEnum myStatus;
Enum.TryParse("Active", out myStatus);