Random.GetHexString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| GetHexString(Int32, Boolean) |
Creates a string filled with random hexadecimal characters. |
| GetHexString(Span<Char>, Boolean) |
Fills a buffer with random hexadecimal characters. |
GetHexString(Int32, Boolean)
- Source:
- Random.cs
Creates a string filled with random hexadecimal characters.
public string GetHexString(int stringLength, bool lowercase = false);
member this.GetHexString : int * bool -> string
Public Function GetHexString (stringLength As Integer, Optional lowercase As Boolean = false) As String
Parameters
- stringLength
- Int32
The length of string to create.
- lowercase
- Boolean
true if the hexadecimal characters should be lowercase; false if they should be uppercase.
The default is false.
Returns
A string populated with random hexadecimal characters.
Applies to
GetHexString(Span<Char>, Boolean)
- Source:
- Random.cs
Fills a buffer with random hexadecimal characters.
public void GetHexString(Span<char> destination, bool lowercase = false);
member this.GetHexString : Span<char> * bool -> unit
Public Sub GetHexString (destination As Span(Of Char), Optional lowercase As Boolean = false)
Parameters
- lowercase
- Boolean
true if the hexadecimal characters should be lowercase; false if they should be uppercase.
The default is false.