Format byte to string to string using the standard format in CSharp
Description
The following code shows how to format byte to string to string using the standard format.
Example
//from ww w . jav a2 s.c o m
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
sbyte[] values = { -1, 0, 1 };
string[] specifiers = { "G", "C", "D3", "E2", "e3", "F",
"N", "P", "X", "00.0", "#.0",
"000;(0);**Zero**" };
foreach (sbyte value in values)
{
foreach (string specifier in specifiers){
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
}
}
}
}