I'm creating a .json file from C# code using the JsonConvert.SerializeObject(User)
and System.IO.File.WriteAllText
functions. One of the user attributes is "CONFIG" which is a long multi-line string that is fetched from a DataBase. When opening the new .json file, the "CONFIG" attribute is written on a one really long line with multiple "\n" symbols. How can I change it in order to actually see the string in a multi-line string?
I tried replacing all "\n" for "\n" but it did not change anything. I also print the string on the console just before serializing it and it is printed on multiple lines.
How I want it to be :
...
{
"USER":1,
"SETTINGS": "SETT_1=YES
SETT_2=YES
SETT_3=YES"
}
...
How it is right now:
...
{
"USER":1,
"SETTINGS": "SETT_1=YES\nSETT_2=YES\nSETT_3=YES"
}
...