I have an Array
that is declared as:
var stringsArray: Array<String!> = []
I want to add items to it using code along these lines:
stringsArray.append("String 1")
However, I would like to use an if
statement to detect whether or not what is about to be appended already exists in stringsArray
and if it does, I would like the code to append not to be ran.
I am using Swift.