StringHelper MatchCardinality Method CleanCode C# Libraries v1.2.03 API
Matches the cardinality of the element to the value to yield, for example "1 elephant" or "2 elephants".

Namespace: CleanCode.Data
Assembly: CleanCode (in CleanCode.dll) Version: (1.2.03)

public static string MatchCardinality(
	int value,
	string element

Return Value

value + space + element + "s" as warranted

Note that this does not take into account "es" vs. "s".
See Also