0

I have this list. when i print it:

System.debug(listaCot);

//it shows this
({"Cdocu":"31","Ndocu":"","Item":2,"Codi":"0301-011626","Codf":"45TEL080075C009"}), 
({"Cdocu":"31","Ndocu":"","Item":2,"Codi":"0301-011626","Codf":"45TEL080075C009"})

I want to show it like this:

{"Cdocu":"31","Ndocu":"","Item":2,"Codi":"0301-011626","Codf":"45TEL080075C009"}, 
{"Cdocu":"31","Ndocu":"","Item":2,"Codi":"0301-011626","Codf":"45TEL080075C009"}

How can i do that? I need to pass it as a json to an API. My problem is that when I'm passing it, it goes with the parentheses and I'm trying to remove them.

  • What is your overall objective? Are you trying to serialize some data into JSON? – David Reed Aug 3 at 0:00
  • 2
    You can't alter how System.debug debugs things to the log. That said, what we probably have here is an X-Y problem. What is your underlying "X"? What situation are you trying to solve? Please read about How to Ask, then edit your question to include any additional information so we can assist you. – sfdcfox Aug 3 at 0:30
  • It's a list that I'm passing it to an API but it goes with the parentheses and I'm trying to remove them. – Oscar Aug 3 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.