mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-18 09:07:51 +08:00
Add ContainsIgnoreCase helper to reduce string alloc, cleanup
This commit is contained in:
18
src/Core/Utility/MiscUtility.cs
Normal file
18
src/Core/Utility/MiscUtility.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace UnityExplorer
|
||||
{
|
||||
public static class MiscUtility
|
||||
{
|
||||
private static CultureInfo _enCulture = new CultureInfo("en-US");
|
||||
|
||||
public static bool ContainsIgnoreCase(this string _this, string s)
|
||||
{
|
||||
return _enCulture.CompareInfo.IndexOf(_this, s, CompareOptions.IgnoreCase) >= 0;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user