Package org.aesh.terminal.utils
Class CodePointUtils
java.lang.Object
org.aesh.terminal.utils.CodePointUtils
Utility methods for working with code points.
- Author:
- Ståle W. Pedersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charThe backslash character constant.static final charThe space character constant. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringfromCodePoints(int[] input) Convert an array of code points to a String.static StringReplace spaces with escaped spaces in a word.static int[]Convert a String to an array of code points.
-
Field Details
-
SPACE_CHAR
public static final char SPACE_CHARThe space character constant.- See Also:
-
BACK_SLASH
public static final char BACK_SLASHThe backslash character constant.- See Also:
-
-
Method Details
-
fromCodePoints
Convert an array of code points to a String.- Parameters:
input- the code points- Returns:
- the resulting string
-
toCodePoints
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
Replace spaces with escaped spaces in a word.- Parameters:
word- the word to process- Returns:
- the word with spaces escaped
-