title: c++ substr Visual Studio 2008
body: <p>I tried this simple example in Visual studio 2008 Forms environment:</p>
  
  <pre><code>String^ textn;
  textn = this-&gt;dateTimePicker1-&gt;Value.ToString();
  textn = textn.substr(0, 7);
  </code></pre>
  
  <p>This did not compile with the cryptic message:</p>
  
  <pre><code>1&gt;        type is 'System::String ^'
  1&gt;        did you intend to use '-&gt;' instead?
  </code></pre>
  
  <p>I have googled for about 1 hour now finding out why it fails but I just cannot find an answer. I usually code C# but due to situation at work I have to downgrade to C++ and I find it VERY hard to do the simplest things.</p>