Class StringDisplayUtils

java.lang.Object
me.tongfei.progressbar.StringDisplayUtils

class StringDisplayUtils extends Object
Contains methods to compute the display lengths of characters and strings on a terminal.
Since:
0.9.1
  • Constructor Details

    • StringDisplayUtils

      StringDisplayUtils()
  • Method Details

    • getCharDisplayLength

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

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

      static String trimDisplayLength(String s, int maxDisplayLength)