Skip to content
DucNV_2000 edited this page Mar 1, 2024 · 33 revisions

Common

  • IsInteger checks the input value is an integer or not
static bool IsInteger(float value)
  • GetNumberInAString Gets the first number that appears in the input string
static int GetNumberInAString(string str)
// exp: str = ab234dc => result: 234
// exp: str = ab23df45 => result: 23
  • CallActionAndClean execute the call action and remove the original reference
static void CallActionAndClean(ref Action action)
  • IsNullOrEmpty check null or empty
static bool IsNullOrEmpty<T>(this List<T> source) // Check for null or empty list
static bool IsNullOrEmpty<T>(this T[] source) // Check for null or empty array
static bool IsNullOrEmpty<TKey, TValue>(this Dictionary<TKey, TValue> source) // Check for null or empty dictionary
  • Shuffle
static void Shuffle<T>(this T[] source) // shuffle the elements in the array
static void Shuffle<T>(this List<T> source) // shuffle the elements in the list
static IDictionary<T1, T2> Shuffle<T1, T2>(this IDictionary<T1, T2> source) // shuffle the elements in the dictionary
  • MakeDictionary
static IDictionary<TKey, TValue> MakeDictionary<TKey, TValue>(this TKey[] keys, TValue[] values) // Make a dictionary from an array of keys and an array of values
static IDictionary<TKey, TValue> MakeDictionary<TKey, TValue>(this IList<TKey> keys, IList<TValue> values) // Make a dictionary from a list of keys and an array of values
Clone this wiki locally