mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-12 03:05:06 +00:00
feat: Extension method for checking if a string contains a character
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user