class book{ var nameOfBook: String! } var englishBooks=[book(),book(),book()] var arr = englishBooks.filter { contains($0.nameOfBook, \"rt\") }
In Swift 4.2 use the remove(where:) functionality. filter isn't doing well with memory, remove(where:) does the job better.
remove(where:)
filter
To do what you want:
englishBooks.removeAll { !$0.nameOfBook.contains("English") }