Skip to content

Instantly share code, notes, and snippets.

View digitaldirk's full-sized avatar
❄️

digitaldirk

❄️
  • the woods
View GitHub Profile
@digitaldirk
digitaldirk / CopyrightHelper.cs
Created November 17, 2022 20:03
C# copyright string helper method that takes a DateTime and optionally a string to output something like: © 2010-2022 Company
/// <summary>
/// Gets a copyright string in the form of: "© 2022 CompanyName" or like "© 2016-2022 Person"
/// </summary>
/// <param name="CopyrightStart">DateTime that represents the start date of copyright - only the year is used.</param>
/// <param name="CopyrightHolder">Optional string of copyright holder - empty string is default</param>
/// <returns>Copyright string</returns>
public static string GetCopyrightString(DateTime CopyrightStart, string CopyrightHolder = "")
{
string CopyrightString = string.Empty;