Is there any algorithm in c# to singularize - pluralize a word?

前端 未结 11 1839
臣服心动
臣服心动 2020-12-07 10:55

Is there any algorithm in c# to singularize - pluralize a word (in english) or does exist a .net library to do this (may be also in different languages)?

11条回答
  •  臣服心动
    2020-12-07 11:40

    I whipped one together based on the Rails pluralizer. You can see my blog post here, or on github here

    output = Formatting.Pluralization(100, "sausage"); 
    

提交回复
热议问题