由买买提看人间百态

topics

全部话题 - 话题: x1b
(共0页)
G*********a
发帖数: 1080
1
来自主题: Java版 - how to print text in color?
Thanks, but it doesn't work:
javac Hello.java
Hello.java:4: illegal escape character
{ System.out.println("\x1B[31;mHello");}
^
1 error
After changing it into : System.out.println("\\x1B[31;mHello");
it just print out either: \x1B[31;mHello or \x1B[31mHello
c*****t
发帖数: 1879
2
来自主题: Java版 - how to print text in color?
For red hello world
System.out.println ("\x1B[31mHello World");
It could be \1x1B[31;m as well, not too sure :)

but
(共0页)