StringExtensions.SingularizeOrPluralize Method

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

Overloads

SingularizeOrPluralize(Nullable, String, String, Boolean) Returns a string with the number of items and the singular or plural postfix.
SingularizeOrPluralize(IEnumerable, String, String, Boolean) Returns a string with the number of items in the collection and the singular of plural postfix.

SingularizeOrPluralize(Nullable, String, String, Boolean)

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
System.Nullable{System.Int64}
singular
System.String
plural
System.String
excludeCount
System.Boolean

Returns

System.String

SingularizeOrPluralize(IEnumerable, String, String, Boolean)

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

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

Parameters

enumerable
System.Collections.Generic.IEnumerable{{T}}
singular
System.String
plural
System.String
excludeCount
System.Boolean

Returns

System.String