Q:

How to remove optional from a string value in swift? 

In the code I'm not able to remove optional from the value inside the lbltotalamount. 
The value in lblTotalAmount is not removing its optional value from it. 
Why?  The value in grandtotal gets optional removed but when I assign it to a label it returns an optional value again. 
The lblTottalAmount is getting an optional value.  I want to remove it. 
if success == false {
    var  grandtotal: Any?   = value["total"]
    if grandtotal ! = nil {
        print("O!O!O!O/\(grandtotal!)") 
        grandtotal = String(describing: grandtotal)
        self.lblTotalAmount.text = ([grandtotal]) as!  String  // (here I am not able to remove optional)
    }

A:

The problem is in the line
grandtotal = String(describing: grandtotal)

You check for nil but you don't unwrap the value so it's still an optional. 
And you are misusing String(describing.  Never use it for types which can be converted to String with an init method. 
Use always conditional downcast
if success == false {
   if let grandtotal = value["total"] as?  Double {
       self.lblTotalAmount.text = String(grandtotal)
   }
}

