Say I have a string like this:
String message = "Hi \n Prakash";
I want to print messsage
exactly the way it is rather than printing a newline for \n
.
So the desired output is:
Hi \n Prakash
and not
Hi
Prakash
Please note that we are not allowed to modify the string message
. How do I do this?
Edit: I've used \n
just as an example. There could be similar characters like \t
which could possibly be in my string.