At the very least it ought to check whether the character after the "\" is an "n". As it is, the character is always ignored whatever it is
There is a chance that the "\" character will be in the String and that it should not be ignored and/or neither should the next character