Class CodePointUtils

java.lang.Object
org.aesh.terminal.utils.CodePointUtils

public final class CodePointUtils extends Object
Utility methods for working with code points.
Author:
Ståle W. Pedersen
  • Field Details

    • SPACE_CHAR

      public static final char SPACE_CHAR
      The space character constant.
      See Also:
    • BACK_SLASH

      public static final char BACK_SLASH
      The backslash character constant.
      See Also:
  • Method Details

    • fromCodePoints

      public static String fromCodePoints(int[] input)
      Convert an array of code points to a String.
      Parameters:
      input - the code points
      Returns:
      the resulting string
    • toCodePoints

      public static int[] toCodePoints(String s)
      Convert a String to an array of code points. Uses a direct loop instead of the Stream API for better performance.
      Parameters:
      s - the string
      Returns:
      the code points
    • switchSpacesToEscapedSpacesInWord

      public static String switchSpacesToEscapedSpacesInWord(String word)
      Replace spaces with escaped spaces in a word.
      Parameters:
      word - the word to process
      Returns:
      the word with spaces escaped