Reputation: 11
S = "hello"
System.out.print(s)
I've also tried:
System.out.println("\033[4mhello\033[0m");
This prints out [4mhello[0m
I'm stuck on how to print hello underlined. I search everywhere but got no luck.
Upvotes: 1
Views: 1614
Reputation: 21
use ANSI codes.
like:
public class Main {
public static void main(String[] args) {
System.out.println("\033[4;2m" + "Hello World");
}
}
note:
ANSI-coded strings wont work in windows terminal.
Upvotes: 1