Quantcast
Viewing latest article 1
Browse Latest Browse All 4

Reverse line feed in Windows / Java

Is there a way to write several lines to the system console in Windows, then delete or modify them, using Java? I can write over the same line more than once using the \r carriage return character. The Cygwin command less (a text viewer) manages it (although it's not Java), so I suspect it's possible.

I've tried \u008D which is (according to a page I googled) the reverse line feed character, but it doesn't seem to work.

    System.out.println("1");
    System.out.println("2");
    System.out.print("\u008D");
    System.out.println("3");

outputs

1
2
?3

whereas I'd hoped to see

1
3

Viewing latest article 1
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>