StringExtensions.SingularizeOrPluralize Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

Overloads

SingularizeOrPluralize(long?, string, string, bool) Returns a string with the number of items and the singular or plural postfix.
SingularizeOrPluralize(IEnumerable, string, string, bool) Returns a string with the number of items in the collection and the singular of plural postfix.

SingularizeOrPluralize(long?, string, string, bool)

Returns a string with the number of items and the singular or plural postfix.

public static string SingularizeOrPluralize(this long? count, string singular, string plural, bool excludeCount = false)

Parameters

count
long?
singular
string
plural
string
excludeCount
bool

Returns

string

SingularizeOrPluralize(IEnumerable, string, string, bool)

Returns a string with the number of items in the collection and the singular of plural postfix.

public static string SingularizeOrPluralize<T>(this IEnumerable<T> enumerable, string singular, string plural, bool excludeCount = false)

Parameters

enumerable
System.Collections.Generic.IEnumerable<>
singular
string
plural
string
excludeCount
bool

Returns

string