Add ContainsIgnoreCase helper to reduce string alloc, cleanup

This commit is contained in:
Sinai
2021-04-30 23:43:27 +10:00
parent 74ff1d8f01
commit d76bc1f812
8 changed files with 34 additions and 21 deletions

View 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;
}
}
}