Skip to content

Commit

Permalink
Shortened strings weren't stripped before.
Browse files Browse the repository at this point in the history
  • Loading branch information
Feli499 committed Jan 7, 2024
1 parent 8c0ece1 commit bb6e75e
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -53,14 +53,14 @@ public String shorten(String string, int length) {
StringShortenerPairHolder value = integerStringShortenerPairHolderEntry.getValue();
result = value.apply(result);
if (result.length() <= length)
return StringUtil.capitalizeFirstLetter(result);
return StringUtil.capitalizeFirstLetter(result).strip();

strippedResult = StringUtil.stripWhitespaces(result);
if (strippedResult.length() <= length)
return strippedResult;
}

return StringUtil.capitalizeFirstLetter(result);
return StringUtil.capitalizeFirstLetter(result).strip();
}

private static class StringShortenerPairHolder {
Expand Down

0 comments on commit bb6e75e

Please sign in to comment.