In C#, if you want to read a string without having to escape the characters, you can use an at-quote
String file = @"C:\filename.txt"
which is equivalent to
String file = "C:\\filename.txt"
Is there a simple way to escape an entire string in Java?