Edit

Share via


Random.GetString(ReadOnlySpan<Char>, Int32) Method

Definition

Creates a string populated with characters chosen at random from choices.

public:
 System::String ^ GetString(ReadOnlySpan<char> choices, int length);
public string GetString(ReadOnlySpan<char> choices, int length);
member this.GetString : ReadOnlySpan<char> * int -> string
Public Function GetString (choices As ReadOnlySpan(Of Char), length As Integer) As String

Parameters

choices
ReadOnlySpan<Char>

The characters to use to populate the string.

length
Int32

The length of string to return.

Returns

A string populated with items selected at random from choices.

Exceptions

choices is empty.

length is not zero or a positive number.

Applies to

See also