feat: Extension method for checking if a string contains a character

This commit is contained in:
Chris Cameron
2018-07-19 11:34:48 -04:00
parent 073c231ef1
commit 2166596726

View File

@@ -278,5 +278,19 @@ namespace ICD.Common.Utils.Extensions
return extends.All(char.IsDigit);
}
/// <summary>
/// Returns true if the string contains the given character.
/// </summary>
/// <param name="extends"></param>
/// <param name="character"></param>
/// <returns></returns>
public static bool Contains(this string extends, char character)
{
if (extends == null)
throw new ArgumentNullException("extends");
return extends.Contains(character.ToString());
}
}
}