RandomExtensionsNextString(Random, Int32, Int32, Char) Method
Returns a random
String that has the length between the specified range and consists of the specified
allowedCharacters.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 7.2.0
public static string NextString(
this Random random,
int minLength,
int maxLength,
char[] allowedCharacters
)
<ExtensionAttribute>
Public Shared Function NextString (
random As Random,
minLength As Integer,
maxLength As Integer,
allowedCharacters As Char()
) As String
public:
[ExtensionAttribute]
static String^ NextString(
Random^ random,
int minLength,
int maxLength,
array<wchar_t>^ allowedCharacters
)
[<ExtensionAttribute>]
static member NextString :
random : Random *
minLength : int *
maxLength : int *
allowedCharacters : char[] -> string
- random Random
- The Random instance to use.
- minLength Int32
- The inclusive lower bound of the length of the returned string.
- maxLength Int32
- The inclusive upper bound of the length of the returned string. Must be greater or equal to minLength.
- allowedCharacters Char
- An array containing the allowed characters. Recurring characters may appear in the result more frequently than others.
StringA
String value that has the length greater than or equal to
minLength and less and less than or equal to
maxLength
and contains only the specified characters.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).