C# Byte ToString()

Description

Byte ToString() converts the value of the current Byte object to its equivalent string representation.

Syntax

Byte.ToString() has the following syntax.


public override string ToString()

Returns

Byte.ToString() method returns The string representation of the value of this object, which consists of a sequence of digits that range from 0 to 9 with no leading zeroes.

Example

The following example displays an array of byte values.


using System;/*w  w  w .jav a2s  .  c o  m*/

public class MainClass {
  public static void Main(String[] argv){  
    byte[] bytes = {0, 1, 14, 168, 255};
    foreach (byte byteValue in bytes){
       Console.WriteLine(byteValue);
    }
  }
}

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