How to print an String variable as italicized text

前端 未结 2 1706
无人及你
无人及你 2021-01-21 03:29

I have the following statements inside my class:

String myName = \"Joe\";
System.out.println(\"My name is \" +myName);

I need the value on the

2条回答
  •  被撕碎了的回忆
    2021-01-21 03:52

    Try:

    System.out.println("\033[3mText goes here\033[0m");
    

    Which will output italic text if your console supports it. You can use [1m for bold, etc. Play around with the different values of [nm.

提交回复
热议问题