mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-15 07:56:41 +08:00
More progress
This commit is contained in:
@ -10,9 +10,21 @@ namespace UnityExplorer
|
||||
{
|
||||
private static CultureInfo _enCulture = new CultureInfo("en-US");
|
||||
|
||||
/// <summary>
|
||||
/// Check if a string contains another string, case-insensitive.
|
||||
/// </summary>
|
||||
public static bool ContainsIgnoreCase(this string _this, string s)
|
||||
{
|
||||
return _enCulture.CompareInfo.IndexOf(_this, s, CompareOptions.IgnoreCase) >= 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Just to allow Enum to do .HasFlag() in NET 3.5
|
||||
/// </summary>
|
||||
public static bool HasFlag(this Enum flags, Enum value)
|
||||
{
|
||||
ulong num = Convert.ToUInt64(value);
|
||||
return (Convert.ToUInt64(flags) & num) == num;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user