I'm trying to Serialize a string into JSON content but does not seems its JSON content and I have tried the following
Is there a way to convert to JSON format or you have do manually?
String jsonStr = '[image[1,2,3,4];image2:[2,23];image3:[3,4];image4:[true];image5:[true];image6:[true];]';
String JSONString = JSON.serialize(jsonStr);
system.debug('JSONString : ' +JSONString );
after executing the above in Anonymous Window I get the following result:
"[image[1,2,3,4];image2:[2,23];image3:[3,4];image4:[true];image5:[true];image6:[true];]"
JSON.serialize
method Serializes Apex objects into JSON content.