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.
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.
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.
Try the following code:
public class Main {
public static void main(String[] args) {
System.out.print("\033[4;30m");
System.out.println("Hello World!");
System.out.print("\033[0m");
}
}
Output: