Is there an "old line" character in Java?

Is there an opposite to the newline character '\n' in Java, which will return to the previous line in the console?

+4
source share
2 answers

ASCII does not standardize the line hunger or reverse link symbol. Some character terminals / terminal emulators recognize sequences of control codes that move the cursor up the line; they are independent of Java and depend on your OS and configuration. Here's the starting point if you are using Linux: http://www.kernel.org/doc/man-pages/online/pages/man4/console_codes.4.html

+9
source

Java supports Unicode, which has the character "REVERSE LINE FEED" (U + 008D) . In Java, it will be '\u008D' (like a char ) or "\u008D" (like a String ). Whether it will do what you want on the console, a printout or something else depends on the device. Java does not define behavior for this character.

+5
source

Source: https://habr.com/ru/post/1446842/


All Articles