DateTime Shorting in c#

Total Post:33

Points:231

C# 
C#
 2796  View(s)
Ratings:
Rate this:
How to short list of month in MMMM-yy formate?????
  1. Re: DateTime Shorting in c#

    String.Format("{0:MMMM-yy}",DateTime.Now)

  1. Re: DateTime Shorting in c#

    I've Solved this myself ...

    string str="Jan-14,Apr-13,Feb-14,May-13,Mar-14,Nov-13,Oct-13,Jun-13,Sep-13,Aug-13,Dec-13,Jul-13";

    In String >>>>

    string sortedlist = string.Join(",", str.Split(',').OrderBy(s => DateTime.ParseExact(s, "MMM-yy", CultureInfo.CurrentCulture)).ToArray());

    In ListBox >>>>

    listBox1.DataSource = str.Split(',').OrderBy(s => DateTime.ParseExact(s, "MMM-yy", CultureInfo.CurrentCulture)).ToArray();

      Modified On Apr-04-2018 05:19:58 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.