title: Unable to solve this Null issue in swift 4?
body: <p>I am trying to check value which I am receiving from the server, if a string is empty I am using the following condition.</p>
  
  <pre><code> var line2Cvar = permanentCAddVarDictionary?["line2"] as! String
                      if line2Cvar.isEmpty {
                          line2Cvar = "---"
                      }
                      self.permanentCAddDic.setValue(line2Cvar, forKey: "line2Cvar")
  </code></pre>
  
  <p>if a string is null I am using the following condition.</p>
  
  <pre><code> var line2Cvar = permanentCAddVarDictionary?["line2"]
  
                      if line2Cvar is NSNull {
                          line2Cvar = "----"
                      }
                      self.emergencyContactDic.setValue(line2Cvar, forKey: "line2Cvar")
  </code></pre>
  
  <p>but in my case sometimes I am getting empty and sometimes I am getting a null value. how check string is empty or null directly. </p>