title: How to compare the contents of two string objects in PowerShell
body: <p>In PowerShell I have an array of string objects, and I have an object that contains string objects. In Java you can do a <code>.equals(aObject)</code> to test if the string values match, whereas doing a <code>==</code> test if the two objects refer to the same location in memory.</p>
  
  <p>How do I run an equivalent <code>.equals(aObject)</code> in powershell?</p>
  
  <p>I'm doing this:</p>
  
  <pre><code>$arrayOfStrings[0].Title -matches $myObject.item(0).Title
  </code></pre>
  
  <p>These both have the exact same string values, but I get a return value of false. Any suggestions?</p>