I want to be able to type something like:
Console.WriteLine(\"You have {0:life/lives} left.\", player.Lives);
instead of
Consol
using @Darin Dimitrov solution, I would create an extention for string ....
public static Extentions
{
public static string Pluralize(this string str,int n)
{
if ( n != 1 )
return PluralizationService.CreateService(new CultureInfo("en-US"))
.Pluralize(str);
return str;
}
}
string.format("you have {0} {1} remaining",liveCount,"life".Pluralize());