String removeAlienCharacters(String str){
String newString = new String();
String returnString = "";
if(str.contains("<")){
String[] str2 = str.split("<");
str = str2[0];
}
for(char x: str.toCharArray()){
if((x >= 48 && x <= 57) || (x>=65 && x <= 90) || (x >= 97 && x<= 122) || x=='.'){
returnString += x;
}
}
return returnString.trim();
}
|