Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print underlined string in console output in java

Tags:

java

string

I want to know if there is any way to print the underlined text on console using java String class.

like image 688
Harshal Avatar asked Mar 22 '23 01:03

Harshal


1 Answers

You can only rely on how the String is interpreted by your console. For example, in bash, you can do something like inserting your string between escape sequences \033[1m and \033[0m (for bold):

\033[1mInsert your String here\033[0m

You should read the documentation of your favorite console.

like image 67
Arnaud Denoyelle Avatar answered Mar 24 '23 15:03

Arnaud Denoyelle