File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/main/java/io/github/malczuuu/problem4j/core Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,14 @@ private static boolean shouldBeHexed(char character) {
4848 || character >= '\u2000' && character <= '\u20FF' ;
4949 }
5050
51+ /**
52+ * Appends the Unicode hexadecimal escape sequence for the given character to the result. The
53+ * escape sequence is in the format {@code "\\uXXXX"}, where {@code "XXXX"} is the uppercase
54+ * hexadecimal representation of the character code, padded with leading zeros to four digits.
55+ *
56+ * @param result the StringBuilder to append the escape sequence to
57+ * @param character the character to be escaped
58+ */
5159 private static void hex (StringBuilder result , char character ) {
5260 String hexedCharacter = Integer .toHexString (character );
5361 result .append ("\\ u" );
You can’t perform that action at this time.
0 commit comments