title: If statement for string not running using equals, but contains works
body: <p>I am working on an android program that needs to identify what Wifi network a user is connected to before it implements a certain action. This is the code that I run to accomplish this: </p>
  
  <pre><code>     public String isConectedToPrivateNet(StringBuilder ssid) {
  
  
      WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
      WifiInfo wifiInfo = wifiManager.getConnectionInfo();
  
      ssid.replace(0, ssid.length(), wifiInfo.getSSID());
          Log.e("Data(b4 iF): ", ssid.toString());
      if(ssid.toString().equals("ACHILLES 101010")) {
          Log.e("Data (iN iF): ", ssid.toString());
  
      }else {
          ssid.replace(0, ssid.length(), "DIDN'T START");
  
      }
  
      return ssid.toString();
  
  }
  </code></pre>
  
  <p>Basically this is supposed to just return the the SSID name if the if statement is true right? But it doesn't, instead it returns the "DIDN'T START". When I read my logs though, the "Data(b4 if): " shows that SSID being "ACHILLES 101010". I therefore assume that the if statement should evaluate to true, why doesn't it do so?</p>
  
  <p>Here is something interesting though: If I replace the .equals(), with a .contains(), the code in the if statement block runs perfectly, and the SSID is returned. Why is this so?</p>
  
  <p>*A few notes: the StringBuilder is passed as being empty here is it's declaration and initialisation </p>
  
  <pre><code>public StringBuilder ssid = new StringBuilder("");
  </code></pre>
  
  <p>* I also tried to use StringBuffer, and the same occurred.   </p>