Java: ignore escape sequences

For my command line interfaces, it is often useful to have some ASCII art at the beginning, but they often contain a lot of backslashes.

eg:

System.out.println(" _____ _______ _____ _ __ "); System.out.println(" / ____|__ __|/\ / ____| |/ / "); System.out.println("| (___ | | / \ | | | ' / "); System.out.println(" \___ \ | | / /\ \| | | < "); System.out.println(" ____) | | |/ ____ \ |____| . \ "); System.out.println("|_____/ |_/_/ \_\_____|_|\_\ "); 

But since each "\" must be "\\", it often looks very ugly in the code, and it is very difficult to find / fix a bug in the "font". Is there a way to tell Java NOT to use escape sequences?

+7
source share
4 answers

No, Java has nothing like C # “shorthand string literals”. If you want to make ASCII art, consider inserting it into a text file and loading it from code.

+3
source

read that "image" from the file, this file may be in your jar library :)

+2
source

Sorry dude. There is no such animal.

+1
source

Hate the grave of this thread, but for someone else there they are looking for it. Try using unicode!

For example: \ u0092 = "\"

+1
source

All Articles