Class StringDisplayUtils


  • class StringDisplayUtils
    extends java.lang.Object
    Contains methods to compute the display lengths of characters and strings on a terminal.
    Since:
    0.9.1
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static int getCharDisplayLength​(char c)
      Returns the display width of a Unicode character on terminal.
      (package private) static int getStringDisplayLength​(java.lang.String s)
      Returns the display width of a Unicode string on terminal.
      (package private) static java.lang.String trimDisplayLength​(java.lang.String s, int maxDisplayLength)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringDisplayUtils

        StringDisplayUtils()
    • Method Detail

      • getCharDisplayLength

        static int getCharDisplayLength​(char c)
        Returns the display width of a Unicode character on terminal.
      • getStringDisplayLength

        static int getStringDisplayLength​(java.lang.String s)
        Returns the display width of a Unicode string on terminal.
      • trimDisplayLength

        static java.lang.String trimDisplayLength​(java.lang.String s,
                                                  int maxDisplayLength)