mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-22 23:58:48 +00:00
🎖 Credit original author of string.EnumParse
This commit is contained in:
parent
5c447f1b02
commit
72f9474e1c
@ -71,6 +71,8 @@
|
||||
/// <typeparam name="T">The type of the <see cref="Enum"/>.</typeparam>
|
||||
/// <param name="value">The <see cref="string"/> value to parse.</param>
|
||||
/// <returns>The <see cref="Enum"/> value corresponding to the <see cref="string"/>.</returns>
|
||||
/// <remarks>Credit for this method goes to Scott Dorman:
|
||||
/// (http://geekswithblogs.net/sdorman/Default.aspx)</remarks>
|
||||
public static T EnumParse<T>(this string value)
|
||||
{
|
||||
return value.EnumParse<T>(false);
|
||||
@ -83,6 +85,8 @@
|
||||
/// <param name="value">The <see cref="string"/> value to parse.</param>
|
||||
/// <param name="ignoreCase">Whether or not to ignore casing.</param>
|
||||
/// <returns>The <see cref="Enum"/> value corresponding to the <see cref="string"/>.</returns>
|
||||
/// <remarks>Credit for this method goes to Scott Dorman:
|
||||
/// (http://geekswithblogs.net/sdorman/Default.aspx)</remarks>
|
||||
public static T EnumParse<T>(this string value, bool ignoreCase)
|
||||
{
|
||||
if (value is null)
|
||||
|
Loading…
Reference in New Issue
Block a user