title: vb.net Passing variables into a string using String.Format
body: <p>Just starting with vb.net.</p>
  
  <p>I am trying to create a valid JSON string from variables.</p>
  
  <pre><code>Dim var1 As String = """object"":""" + anotherVar + """"
  Dim var2 As String = """object2"":""" + anotherVar + """"
  Dim var3 As String = """object3"":""" + anotherVar + """"
  
  Dim jsonData As String = String.Format("{ {0}, {1}, ""somestruct"": { {2} }}", var1, var2, var3)
  </code></pre>
  
  <p>Obviously I'm doing something wrong. The variable jsonData is formatted incorrectly.</p>
  
  <p>It should look like this if it was pure JSON.</p>
  
  <pre><code>{
  "object": "string",
  "object2": "string",
  "somestruct": {
      "object3": "string"
  }
  </code></pre>
  
  <p>Probably missing something silly. Totally new here, so feel free to redirect me to a better method. Thank you!</p>