title: String contains method return false even when string contains substring
body: <p>I have a string: </p>
  
  <blockquote>
    <p>20160719_P_BID_20160718_130000</p>
  </blockquote>
  
  <p>I need to check if this string contains the substring "BID". I have tried various methods like:</p>
  
  <ol>
  <li><code>.contains("BID") / .contains("_BID_")</code></li>
  <li><code>.indexOf("BID")</code>  </li>
  <li><code>.substring(11,14).equals("BID)</code></li>
  </ol>
  
  <p>but all methods have returned <code>false</code> even though the output of the strings does contain the string <code>"BID"</code> and is the string <code>"BID"</code></p>
  
  <p>Update:</p>
  
  <pre><code>String fileName = file.getFileName();
  String tradeTypeStr = fileName.substring(11,14);        
  if(tradeTypeStr.equalsIgnoreCase(tradeType))
  </code></pre>
  
  <p>Can someone shed some light as to why the methods are returning false?</p>
  
  <p>Thanks for your help!</p>