mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
feat: Extension method for checking if a string contains a character
This commit is contained in:
parent
073c231ef1
commit
2166596726
1 changed files with 14 additions and 0 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue