Java String Pluralize pluralize(String base, int quantity)

Here you can find the source of pluralize(String base, int quantity)

Description

pluralize

License

Open Source License

Declaration

public static String pluralize(String base, int quantity) 

Method Source Code

//package com.java2s;

public class Main {
    public static String pluralize(String base, int quantity) {
        if (quantity == 1)
            return base;
        else if (base.trim().toLowerCase().endsWith("s"))
            return base + "es";
        else/*w  ww.  j a  va  2s .  c  o m*/
            return base + "s";
    }
}

Related

  1. Pluralize(int quantity, String units)
  2. pluralize(int value, CharSequence singularForm, CharSequence pluralForm)
  3. pluralize(long count, String singularFormat, String pluralFormat)
  4. pluralize(long strictlyPositiveCount, String singular, String plural)
  5. pluralize(long val, String singular, String plural)
  6. pluralize(String input)
  7. pluralize(String name)
  8. pluralize(String name)
  9. pluralize(String name)