byte format
In this chapter you will learn:
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:
- Convert byte value to its base 2(Binary), base 8(Octal) and base 16(Hex) forms
- Format byte value to its hexadecimal form
Home » C# Tutorial » Byte, Integer, Long