Java String Pluralize plural(int count, String word, String ending)

Here you can find the source of plural(int count, String word, String ending)

Description

Return plural word if count is bigger than one

License

Open Source License

Parameter

Parameter Description
count a parameter
word a parameter
ending a parameter

Declaration

public static String plural(int count, String word, String ending) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from   ww w  .  ja  v  a  2 s.  com
     * Return plural word if count is bigger than one
     *
     * @param count
     * @param word
     * @param ending
     * @return
     */
    public static String plural(int count, String word, String ending) {
        return count == 1 ? word : word + ending;
    }
}

Related

  1. plural(int amount)
  2. plural(int nb)
  3. plural(int number, String form1, String form2, String form3)
  4. plural(int size, String name)
  5. plural(String arg)