How to remove a specific object from a string array.
array = ["mac","iPhone","iPad"]
Is there a way to remove a specific row in an array, for example, for example, I wanted to remove the "iPhone" without using removeAtIndex (1)
Use a filter for this purpose.
var array = ["mac","iPhone","iPad"] array = array.filter() { $0 != "mac" } print(array) // will print ["iPhone", "iPad"]
Source: https://habr.com/ru/post/1622994/More articles:Could not find class rx.android.schedulers.AndroidSchedulers - androidUse filebeat or logstash to open gzip files - elasticsearch"Content-Type" в заголовках ответов всегда "application/octet-stream" - content-typeHow to disable the Raygun.io client through application configuration? - c #How to put data using a button in a table through a foreign key? - htmlHow to remove angular generated element in DOM - javascriptChrome extension: how to make executescript standby background? - javascriptRun python script in virtual environment from windows task scheduler - python-3.xCode The first issue with the seeding data in Cyrillic - c #Cannot insert cyrillic characters correctly in NTEXT field in SQL Server database - c #All Articles