Click or drag to resize

ExtensionMethodsTryAddAtFirstNullT Method

Attempts to add an item to an array in the first spot it can find that's null.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: (
public static bool TryAddAtFirstNull<T>(
	this T[] array,
	T itemToAdd,
	bool searchInReverseOrder = false


Type: T
The array to add an item to
Type: T
The item to add to the array, if possible
searchInReverseOrder (Optional)
Type: SystemBoolean
Whether or not to search starting from the end, defaulted to false

Type Parameters

The type of array

Return Value

Type: Boolean
True if the item was added to the array

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also