Here you can find the source of toPlural(String candidate)
Parameter | Description |
---|---|
candidate | a parameter |
public static String toPlural(String candidate)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { /**// ww w . j a v a 2s .c o m * Converts string to plural form * * @param candidate * * @return plural string */ public static String toPlural(String candidate) { if (candidate.length() >= 1 && !candidate.endsWith("s")) { return candidate + "s"; } return candidate; } }