 | StringExtensionsGetRandom Method (String, Int32) |
Returns a random string of the specified length
Namespace:
TestHelperExtensions
Assembly:
CBI.TestHelperExtensions (in CBI.TestHelperExtensions.dll) Version: 2.1.0.1
Syntaxpublic static string GetRandom(
this string ignored,
int length
)
<ExtensionAttribute>
Public Shared Function GetRandom (
ignored As String,
length As Integer
) As String
public:
[ExtensionAttribute]
static String^ GetRandom(
String^ ignored,
int length
)
[<ExtensionAttribute>]
static member GetRandom :
ignored : string *
length : int -> string
Parameters
- ignored
- Type: SystemString
This parameter is used only to determine variable type. By
the time we have reached this method, the type has already been determined by
the runtime and the parameter is no longer needed. - length
- Type: SystemInt32
The length of the desired random string.
Return Value
Type:
StringThe resulting random string value.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
String. 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