This seems to work for me so far:
private static void TitleCheck(String n){
boolean found = false;
String title = null;
int pos;
pos = n.indexOf(':');
if(pos != -1){
title = n.substring(0,pos);
if(Titles.size()==0){
Titles.add(title);
}
for(String i:Titles){
if(i.equals(title)){
found = true;
break;
}
}
}
if (found ==false && pos !=-1){
Titles.add(title);
}
}
Have not really tested it properly but delivering the results I was wanting, so far.
I will have a look at the method you suggested, as this probably is not the best way of doing things. Any other tips/code improvements are welcome, as the way Im doing things might not be the best practice. Thanks for the help so far!