Package com.day.text

Class StringAbbreviator


  • public class StringAbbreviator
    extends Object
    String abbreviator that uses a macosx-style ellipsis algorithm, where an ellipsis is added in the middle of a string instead of at the end.
    • Constructor Detail

      • StringAbbreviator

        public StringAbbreviator()
    • Method Detail

      • abbreviate

        public String abbreviate​(String str,
                                 int maxLength)
        Abbreviate str if needed, so that its number of characters is <= maxChars
      • setEllipsis

        public void setEllipsis​(String s)
        Set our ellipsis string, to the default if s is null
      • getEllipsis

        public String getEllipsis()