Answers for "swift remove value dictionary"

0

swift remove value dictionary

var someDict:[Int:String] = [1:"One", 2:"Two", 3:"Three"]
var removedValue = someDict.removeValue(forKey: 2)

print( "Value of key = 1 is \(someDict[1])" )
print( "Value of key = 2 is \(someDict[2])" )
print( "Value of key = 3 is \(someDict[3])" )
Posted by: Guest on March-11-2022

Code answers related to "swift remove value dictionary"

Code answers related to "Swift"

Browse Popular Code Answers by Language