src/ie/gmit/sw/ai/Filter.java
public String charSingleOccurance(String s) {
		StringBuilder result = new StringBuilder();
		char last = '\u0000';
		
		//loop over every character in the string
		for (char c : s.toCharArray()) {
		     if (last == '\u0000' || c != last) {
		    	 result.append(c);
		    	 last = c;
		    }//if	
		    else {
		    	result.append("X");
		 	}//else
		}//for
		return result.toString();
	}
//replaces the second occurence of a letter with an X e.g. LETTERKENNY -> LETXERKENXY
replaces the second occurence of a letter with an X e.g. LETTERKENNY -> LETXERKENXY
replaces the second occurence of a letter with an X e . g . LETTERKENNY - > LETXERKENXY
public String charSingleOccurance(String s) {
		StringBuilder result = new StringBuilder();
		char last = '\u0000';
		for (char c : s.toCharArray()) {
		     if (last == '\u0000' || c != last) {
		    	 result.append(c);
		    	 last = c;
		    }
		    else {
		    	result.append("X");
		 	}
		}
		return result.toString();
	}
public String charSingleOccurance ( String s ) { StringBuilder result = new StringBuilder ( ) ; char last = '\u0000' ; for ( char c : s . toCharArray ( ) ) { if ( last == '\u0000' || c != last ) { result . append ( c ) ; last = c ; } else { result . append ( "X" ) ; } } return result . toString ( ) ; }
replaces the second occurence of a letter with an X e.g.
replaces the second occurence of a letter with an X e . g .
//loop over every character in the string //if	 //else //for