SoFunction
Updated on 2025-03-07

C# Get the date's name of the week instance code

The specific code is as follows:

private string GetWeekName(DayOfWeek week)
    {
      string weekName = "";
      switch (week)
      {
        case :
          weekName = "Friday";
          break;
        case :
          weekName = "on Monday";
          break;
        case :
          weekName = "Saturday";
          break;
        case :
          weekName = "Sunday";
          break;
        case :
          weekName = "Thursday";
          break;
        case :
          weekName = "Tuesday";
          break;
        case :
          weekName = "Wednesday";
          break;
        default:
          break;
      }
      return weekName;
    }

How to use:

GetWeekName(),

Summarize

The above is the example code of the C# acquisition date of the week name introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support for my website!