/
SByte.NotIn.cs
23 lines (22 loc) · 1.05 KB
/
SByte.NotIn.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Description: C# Extension Methods | Enhance the .NET Framework and .NET Core with over 1000 extension methods.
// Website & Documentation: https://csharp-extension.com/
// Issues: https://github.com/zzzprojects/Z.ExtensionMethods/issues
// License (MIT): https://github.com/zzzprojects/Z.ExtensionMethods/blob/master/LICENSE
// More projects: https://zzzprojects.com/
// Copyright © ZZZ Projects Inc. All rights reserved.
using System;
public static partial class Extensions
{
/// <summary>
/// A T extension method to determines whether the object is not equal to any of the provided values.
/// </summary>
/// <param name="this">The object to be compared.</param>
/// <param name="values">The value list to compare with the object.</param>
/// <returns>true if the values list doesn't contains the object, else false.</returns>
/// ###
/// <typeparam name="T">Generic type parameter.</typeparam>
public static bool NotIn(this SByte @this, params SByte[] values)
{
return Array.IndexOf(values, @this) == -1;
}
}