title: Compare a String reconstructed from a byte array with another String
body: <p>Can somebody please point me to the right direction?</p>
  
  <p>I am receiving a datagram packet, which I store to a string.
  When I compare that string, to another one, it will result in false.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>private static String KEY = "Iamastring";
  
      String sentence = new String( receivePacket.getData(), "UTF-8"); //Reconstruct the string
      sentence.trim();
      System.out.println("RECEIVED: " + sentence + " test " + KEY + " test ");
      System.out.println("Length: " + sentence.length() + " " + KEY.equals(sentence));
  </code></pre>
  
  <p>And this is my output:</p>
  
  <pre><code>RECEIVED: Iamastring
  Length: 1024 false
  </code></pre>
  
  <p>The expected comparison of KEY.equals(sentence) is true.</p>