Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assuming the JSON value is a string type and contains nested quotation marks, one approach to removing them is by escaping the inner quotation marks using the backslash () character. For example, the following JSON value with nested quotation marks:

{ "name": "\"John Doe\"", "age": 30 }

can be transformed into:

{ "name": "\"John Doe\"", "age": 30 }

Notice how the inner quotation marks are now preceded by a backslash to escape them. Another approach is to use single quotes for the outermost layer of the JSON value, and double quotes for the inner layer. This way, there will be no conflict between the quotes. For example:

{ "name": '"John Doe"', "age": 30 }