Java String Singularize singularPlural(int n, String singular, String plural)

Here you can find the source of singularPlural(int n, String singular, String plural)

Description

singular Plural

License

Apache License

Declaration

public static String singularPlural(int n, String singular, String plural) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String singularPlural(int n, String singular, String plural) {
        if (n < 0) {
            throw new IllegalArgumentException("n = " + n + " < 0");
        }/*from  w w w  .j a v  a  2  s . c  om*/
        return n + " " + (n <= 1 ? singular : plural);
    }
}

Related

  1. singular(String plural)
  2. singularise(String name)
  3. singularize(final String buffer)
  4. singularize(String value)
  5. singularOrPlural(int testValue, String singular, String plural)
  6. SingularToPlural(String noun)