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?
No, unfortunately not.
As a side note: If you don’t want to support Windows 9x and ME anymore, you can use “/” as folder separator. It works on all operating systems, including Microsoft Windows since 2000.