C# Random ToString

Description

Random ToString returns a string that represents the current object.

Syntax

Random.ToString has the following syntax.


public virtual string ToString()

Returns

Random.ToString method returns A string that represents the current object.

Example

The following example shows how to use Random.ToString method.


//w  ww  .  j av a  2 s .  co m
using System;

public class MainClass
{
    static void Main()
    {
        Random randObj = new Random(1);

        Console.WriteLine(randObj.ToString());
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version