 | ExtensionMethodskOneOfT Method |
Returns a random entry from an array of strings/numebers.
Namespace:
Koden.Utils.Extensions
Assembly:
Koden.Utils (in Koden.Utils.dll) Version: 1.1.6453.26060
Syntaxpublic static T kOneOf<T>(
this Random rng,
params T[] items
)
<ExtensionAttribute>
Public Shared Function kOneOf(Of T) (
rng As Random,
ParamArray items As T()
) As T
public:
[ExtensionAttribute]
generic<typename T>
static T kOneOf(
Random^ rng,
... array<T>^ items
)
[<ExtensionAttribute>]
static member kOneOf :
rng : Random *
items : 'T[] -> 'T
Parameters
- rng
- Type: SystemRandom
The random number. - items
- Type: T
The items to choose from.
Type Parameters
- T
- number, string, type
Return Value
Type:
TRandom generic of any Type in a list of arguments
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Random. 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