ServerManagers/src/ServerManager.Common/Extensions/StringExtensions.cs
Brett Hewitson 46997c6e71 Setting Find Changes
- added a find window to find setting in the settings control.
2022-06-18 15:29:22 +10:00

17 lines
666 B
C#

using System;
namespace ServerManagerTool.Common.Extensions
{
public static class StringExtensions
{
public static bool Contains(this string value, string substring, StringComparison comparisonType)
{
if (substring == null)
throw new ArgumentNullException(nameof(substring), $"{nameof(substring)} cannot be null.");
if (!Enum.IsDefined(typeof(StringComparison), comparisonType))
throw new ArgumentException($"{nameof(comparisonType)} is not a member of StringComparison", nameof(comparisonType));
return value.IndexOf(substring, comparisonType) >= 0;
}
}
}