I am writing a JSON file which would be read by a Java program. The fragment is as follows...
{
\"testCases\" :
{
\"case.1\" :
{
\"scenario
As I could understand the question is not about how pass a string with control symbols using json
but how to store and restore json in file where you can split a string with editor control symbols.
If you want to store multiline string in a file then your file will not store the valid json
object. But if you use your json
files in your program only, then you can store the data as you wanted and remove all newlines from file manually each time you load it to your program and then pass to json parser.
Or, alternatively, which would be better, you can have your json
data source files where you edit a sting as you want and then remove all new lines with some utility to the valid json
file which your program will use.