Is there any way to use raw strings in Java (without escape sequences)?
(I\'m writing a fair amount of regex code and raw strings would make my code immensely more r
String#getBytes() exposes a copy of the internal byte array contained in every single String object which actually contains the 16-bit UTF-16 encoded String - the byte array will contain the same string converted to match the platform's default charset. What I'm saying is that I think this is as close to "raw" string as you can ever get in Java.