Skip to content

Instantly share code, notes, and snippets.

@brazilnut2000
Created July 26, 2013 19:17
Show Gist options
  • Save brazilnut2000/6091489 to your computer and use it in GitHub Desktop.
Save brazilnut2000/6091489 to your computer and use it in GitHub Desktop.
C#: Return the singular or plural version of a word based on how many there are
static string GetPluralized(string word, int count)
{
return count == 1 ? word : word + "s";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment