@Junky: As far as i take this problem, OP means to keep record of Strings(characters) replaced by "n".

Am i right javapenguin?
Forexample: