harshal harshal - 1 day ago 4
Java Question

How to print underlined string in console output in java

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

Answer

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.

Comments