Basically i have a program to read in the contents of a folder and capture instances of a substring stored between two strings. I want the instances of the substring called "resourceline" to be stored within an array and then sorted and printed into a new document.
However i only want the instances to be stored IF they dont already exist and if the string does not contain certain symbols. I am doing this because i get too much irrelevant data come accross.
The problem is the progam is working but still writing data that i dont want.
As I see it, this should follow your requirement about duplicates, but ignore your requirement about special characters. There are two completely unconnected conditionals: the first one, "if (checkContains1...", controls access to an empty block, so it does absolutely nothing. Then the next conditional is tested regardless of the outcome of the first. It checks for duplicates, and otherwise then adds the line to the list.
If your "checkContains" check had a "continue" in it, or if it was attached to the later conditional with an "else", then we'd be getting somewhere.