C# Array ToString

Description

Array ToString returns a string that represents the current object.

Syntax

Array.ToString has the following syntax.


public virtual string ToString()

Returns

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

Example


using System;//from w ww .  j  a  v a  2 s . co  m
public class Example
{
    public static void Main()
    {
        int[] myValuesizes = { 40, 5, 3, 22, 1, 18 };

        Console.WriteLine(myValuesizes.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