var optionalValue: String? = nil
extension String {
var convertSign: String {
if self.hasPrefix("-") {
return String(self.dropFirst())
} else {
return "-\(self)"
}
}
}
print(optionalValue?.convertSign)
//nil