title: How does Visual Basic store Strings in memory?
body: <p>I ran into a situation where I needed to find the memory address of a String that I use in a piece of VB Code. I tried using various debuggers and also using the simple procexplorer to display a list of printable strings in memory. But it does not show anything which puzzles me. Does VB (.net framework 4) use some kind of encoding mechanism to store strings so that it does not appear in a printable format ?</p>
  
  <p>Here's the variable am trying to locate in memory: "spoilt"</p>
  
  <pre><code>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
          MessageBox.Show("Button1")
          Dim spoilt As String
          spoilt = TextBox1.Text
          Label1.Text = spoilt
  
  
      End Sub
  </code></pre>