How do I remove Optional word
public func getCurrencySymbolFromCurrencyCode(currencyCode: String) -> String {
// let currencyCode: String = "EUR"
let locale: NSLocale = NSLocale(localeIdentifier: currencyCode)
let currencySymbol: String = "\(locale.displayNameForKey(NSLocaleCurrencySymbol, value: currencyCode))"
print("Currency Symbol : \(currencySymbol)")
return currencySymbol
}
Above code produces as follow:
Optional("$")
My question is why there is Optional("$")
there, how can I remove the optional and just printing $