title: How to place variable in char array on arduino?
body: <p>these is my code.</p>
  
  <pre><code>#include &lt;ArduinoJson.h&gt;
  void setup() {
  Serial.begin(9600);
  }
  void loop() {
  if(Serial.read()=='j')
  {
    StaticJsonDocument&lt;256&gt; docc;
    char  json[] =
    "{\"ID\":\"01\",\"Value\":[\"1\",\"2\"]}";
    deserializeJson(docc, json);
    JsonObject object = docc.as&lt;JsonObject&gt;();
  
    DynamicJsonDocument doc(1024);
   JsonArray result = doc.createNestedArray("result");
    result.add(object);
    serializeJsonPretty(doc,Serial);
    }
  }
  </code></pre>
  
  <p>I want to place the variable in json array, like this</p>
  
  <pre><code> "{\"ID\":\"01\",\"Value\":[\"{variable1}\",\{variable2}\"]}";
  </code></pre>
  
  <p>the variable1 and variable2 is char type, i want to read sensor data and assignment, then place these variable to json char array to create json object.
  Can anyone give some example to place variable  in the char array?
  Thank you. </p>