public static function abbreviate(
        $inputString,
        $lowerLimit,
        $upperLimit = -1,
        $append = StringUtils::EMPTY_STR
    ) {
        if (true === StringUtils::isEmpty($inputString)) {
            return $inputString;
        }

        $length = StringUtils::length($inputString);

        // if the $lowerLimit value is greater than the length of the string,
        // set to the length of the string
        if ($lowerLimit > $length) {
            $lowerLimit = $length;
        }

        // if the $upperLimit value is -1 (i.e. no limit) or is greater than the
        // length of the string, set to the length of the string
        if ((-1 === $upperLimit) || $upperLimit > $length) {
            $upperLimit = $length;
        }

        // if $upperLimit is less than $iLower, raise it to lower
        if ($upperLimit < $lowerLimit) {
            $upperLimit = $lowerLimit;
        }

        $index = StringUtils::indexOf($inputString, ' ', $lowerLimit);

        if (-1 === $index) {
            $result = StringUtils::substring($inputString, 0, $upperLimit);

            if ($upperLimit !== $length) {
                // only if abbreviation has occured do we append the $append
                // value
                $result .= $append;
            }
        } elseif ($index > $upperLimit) {
            $result = StringUtils::substring($inputString, 0, $upperLimit);
            $result .= $append;
        } else {
            $result = StringUtils::substring($inputString, 0, $index);
            $result .= $append;
        }

        return $result;
    }