swift - Removing object from Array -


how can remove specific object array of string.

array = ["mac","iphone","ipad"]  

is there method delete specific string in array, example wanted remove "iphone", without using removeatindex(1)

use filter purpose

var array = ["mac","iphone","ipad"] array = array.filter() { $0 != "mac" } print(array) // print ["iphone", "ipad"] 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -