byte format

In this chapter you will learn:

  1. Converts Byte to string with the culture-specific formatting information

format byte with culture-specific formatting information

using System;//from   jav  a  2  s  .  c  om
using System.Globalization;

public class Example
{
   public static void Main()
   {
        byte byteValue = 168;
        CultureInfo[] providers = {new CultureInfo("en-us"), 
                                   new CultureInfo("fr-fr"), 
                                   new CultureInfo("de-de"), 
                                   new CultureInfo("es-es")};
        foreach (CultureInfo provider in providers){
              Console.Write("{0,3} ({1})", byteValue.ToString(provider), provider.Name);
        }
    }
}

Next chapter...

What you will learn in the next chapter:

  1. Convert byte value to its base 2(Binary), base 8(Octal) and base 16(Hex) forms
  2. Format byte value to its hexadecimal form
Home » C# Tutorial » Byte, Integer, Long
Integer Family
Integer ranges
byte
Convert to byte
Parse string to byte
byte format
byte octal and hexadecimal
byte binary operation
byte overflow with unchecked
int
int value
Compare int value
int calculation
int value overflow
int binary operation
Parse string to int value
Format int value
int in binary, octal and hexadecimal
long
long value calculation
ulong