ExportString
ExportString[expr, "format"] generates a string of expr in the specified format.
Examples
Export to JSON string:
ExportString[{1, 2, 3}, "JSON"]
(* "[1, 2, 3]" *)Export to CSV:
ExportString[{{1, 2}, {3, 4}}, "CSV"]
(* "1,2\n3,4" *)Please visit the official Wolfram Language Reference for more details.