I need a solution to convert String to byte array without changing like this:
Input:
String s=\"Test\";
Output:
String
You may try the following code snippet -
String string = "Sample String"; byte[] byteArray = string.getBytes();