Created
July 26, 2013 19:17
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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