NQualityOfLife.Utils.ListExtensions.ContainsAll - Niilo007/RimWorld-NQoL GitHub Wiki

C#

/// <summary>Checks if the provided string contains or matches all of the strings in the array.</summary>
/// <param name="text"></param>
/// <param name="ofThese"></param>
/// <returns>True if the input matches or contains all of the provided strings. If input text or string array are null or empty; returns false.</returns>
public static bool ContainsAll(this string text, params string[] ofThese)
{

}
/// <summary>Checks if the first list contains all the elements in the second list.</summary>
/// <typeparam name="T"></typeparam>
/// <param name="list"></param>
/// <param name="ofThese"></param>
/// <returns></returns>
public static bool ContainsAll<T>(this List<T> list, params T[] ofThese)
{

}
/// <summary>Checks if the first list contains all the elements in the second list.</summary>
/// <typeparam name="T"></typeparam>
/// <param name="list"></param>
/// <param name="ofThese"></param>
/// <returns></returns>
public static bool ContainsAll<T>(this List<T> list, List<T> ofThese)
{

}
/// <summary>Checks if the first list contains all the elements in the second list.</summary>
/// <typeparam name="T"></typeparam>
/// <param name="list"></param>
/// <param name="ofThese"></param>
/// <returns></returns>
public static bool ContainsAll<T>(this IEnumerable<T> list, List<T> ofThese)
{

}

Usage

if (bedPawns.ContainsAll(drawingPawn, lover))
{

}
if (last.ToString().ContainsAll("get_Current", "Verse.ResearchProjectDef"))
{

}
⚠️ **GitHub.com Fallback** ⚠️