1
Reply

what is the purpose of IFormatProvider in ASP.NET?

syamala m

syamala m

12y
1.7k
0
Reply

    It is a public interface that supplies an object that provides formatting information for formatting and parsing operations. Formatting operations convert the value of a type to the string representation of that value Eg: ToString() Parsing operations convert the string representation of a value to a type with that value. Eg: Typical parsing methods are Parse and TryParse Example: using System; using System.Globalization; DateTime dateValue = new DateTime(2009, 6, 1, 4, 37, 0);CultureInfo[] cultures = { new CultureInfo("en-US"), new CultureInfo("fr-FR"),new CultureInfo("it-IT"),new CultureInfo("de-DE") };foreach (CultureInfo culture in cultures){Response.Write("{0}: {1}" + "-" + culture.Name + "-" + dateValue.ToString(culture));Response.Write("
    ");}