I want to replace, from a JSON file :"[" to :["
The below runs but without delivering the expected.Any clues?(I looked in similar questions, but I was more confused)
string contenty = contentx.Replace(":"["",":["");
return contentx;
You're returning contentx instead of contenty. contenty is the variable that has the new string.
First you have to escape the double quotes with \"
Then you have to return the "return value" of the expression in the same variable, or simply use one return statement:
return contentx.Replace(":\"[\"", ":[\"");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With