30秒学会 C# 片段 – Swap
Swaps the values of two variables of the same type. Pass both values by reference using the ref keyw...
Swaps the values of two variables of the same type. Pass both values by reference using the ref keyw...
Initializes a 2D array of the given width, height and value. Use Enumerable.Repeat() to repeat value...
Filter a string’s contents to include only alphanumeric and allowed characters. Use string.ToC...
Creates a string with the results of calling the provided function on every character in the given s...
Returns a random integer in the specified range. Use Random.nextDouble() to generate a random number...
Combines the elements of an enumerable object into a string. Use string.Join() to combine all elemen...
Returns a random integer in the specified range. Use Random.Next() to generate an integer in the des...
Splits a string into an array of strings using a multicharacter (string) separator. Use string.Split...
Returns true if the given object is not of the specified type, false otherwise. Use the is operator ...
Replaces all but the last n characters in a string with the specified mask character. Use string.Sub...