30秒学会 C# 片段 – IsPowerOfTwo
Returns true if the given number is a power of 2, false otherwise. Use the bitwise binary AND operat...
Returns true if the given number is a power of 2, false otherwise. Use the bitwise binary AND operat...
Converts a string to kebab case. Use Regex.Matches() with an appropriate regular expression to break...
Checks if a string is upper case. Convert the given string to upper case, using string.ToUpper() and...
Reverses a string. Use string.ToCharArray() to convert the string to an array of char, Array.Reverse...
Returns the first index in an IList that matches the given predicate function, match. Use Enumerable...
Converts a string to snake case. Use Regex.Matches() with an appropriate regular expression to break...
Returns the minimum of two DateTime values. Use the conditional operator (?:) to return the minimum ...
Returns tomorrow’s DateTime value. Use DateTime.Now to get the current date, then use DateTime...
Returns true if the provided predicate function returns true for all elements in a collection, false...
Flattens a 2D collection into a single dimension. Use IEnumerable.SelectMany() to flatten the 2D enu...