Suppose you have a json file which includes C style comments
{
"foo": {
"default_level": "debug",
// A comment
"impl": "xyz"
},
"bar": [
{
/*This is a comment*/
"format": "%l%d %c ….",
"rotation": "daily, 1_000_000",
}
]
}
Before this is json is deserialized, using Java
what would be the easiest way to strip these comments off? Lets assume that only single line //
and multiline /**/
comments are supported.
Ultimately, i'd like to read in a String
representation of the same file but w/o comments:
{
"foo": {
"default_level": "debug",
"impl": "xyz"
},
"bar": [
{
"format": "%l%d %c ….",
"rotation": "daily, 1_000_000",
}
]
}