File tree 1 file changed +14
-0
lines changed
FluentCommandLineParser/Internals/Extensions
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 21
21
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
22
// POSSIBILITY OF SUCH DAMAGE.
23
23
#endregion
24
+
25
+ using System . Collections . Generic ;
26
+ using System . Linq ;
27
+
24
28
namespace Fclp . Internals . Extensions
25
29
{
26
30
/// <summary>
@@ -38,5 +42,15 @@ public static bool IsNullOrWhiteSpace(this string value)
38
42
{
39
43
return string . IsNullOrEmpty ( value ) || string . IsNullOrEmpty ( value . Trim ( ) ) ;
40
44
}
45
+
46
+ /// <summary>
47
+ /// Indicates whether the specified <see cref="IEnumerable{T}"/> is <c>null</c> or contains no elements.
48
+ /// </summary>
49
+ /// <param name="enumerable">A <see cref="IEnumerable{T}"/> to check.</param>
50
+ /// <returns><c>true</c> if <paramref name="enumerable"/> is <c>null</c> or contains no elements; otherwise <c>false</c>.</returns>
51
+ public static bool IsNullOrEmpty < TSource > ( this IEnumerable < TSource > enumerable )
52
+ {
53
+ return enumerable == null || enumerable . Any ( ) == false ;
54
+ }
41
55
}
42
56
}
You can’t perform that action at this time.
0 commit comments