src/String/StringTools.php
public static function makeSingular($plural)
    {
        $plurals = ["ies" => "y", "es" => "", "s" => ""];

        foreach ($plurals as $pluralEnding => $singularEnding) {
            $plural = preg_replace("/" . $pluralEnding . "$/i", $singularEnding, $plural);
        }

        return $plural;
    }
public static function makeSingular($plural)
    {
        $plurals = ["ies" => "y", "es" => "", "s" => ""];

        foreach ($plurals as $pluralEnding => $singularEnding) {
            $plural = preg_replace("/" . $pluralEnding . "$/i", $singularEnding, $plural);
        }

        return $plural;
    }
public static function makeSingular ( $ plural ) { $ plurals = [ "ies" => "y" , "es" => "" , "s" => "" ] ; foreach ( $ plurals as $ pluralEnding => $ singularEnding ) { $ plural = preg_replace ( "/" . $ pluralEnding . "$/i" , $ singularEnding , $ plural ) ; } return $ plural ; }
Returns the English singular form of a plural word.

@param $plural

@return string
Returns the English singular form of a plural word .