Skip to main content

C# extension method that returns the plural form of the specified word.

/// <summary>
/// Returns the plural form of the specified word.
/// </summary>
/// <param name="count">How many of the specified word there are. A count equal to 1 will not pluralize the specified word.</param>
/// <returns>A string that is the plural form of the input parameter.</returns>
public static string ToPlural(this string @this, int count = 0)
{
    return count == 1 ? @this : System.Data.Entity.Design.PluralizationServices.PluralizationService.CreateService(new System.Globalization.CultureInfo("en-US")).Pluralize(@this);
}