cancel
Showing results for 
Search instead for 
Did you mean: 

JSON parse error with string has new line characters

deepak_shaw
Contributor

Noticed some times I received JSON parse error when the string contains new line characters.

2 REPLIES 2

bojanvelevski
Valued Contributor

Hey @deepak.shaw,

You should escape the controll characters like new line. Try .replaceAll(‘\n’,‘\n’) on the JSON string, and than parse it.

Regards,

Bojan

deepak_shaw
Contributor

Hi,

Thanks for the reply… but suddenly it starts working, without doing any changes, it parses correctly with replacing any character.