syamala m
what is the purpose of IFormatProvider in ASP.NET?
By syamala m in ASP.NET on Aug 16 2012
  • hj jh
    Aug, 2012 22

    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("
    ");}

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS