This is not really string manipulation. no string is being changed.
the \r and \b come from the old days, when printers had a print head. characters were printed one at a time across the line.
if you've ever seen an old IBM Selectric typewriter, you know what i mean.
anyway, there were only certain characters you could print. if you wanted to underline a
word, you had to print a character, then back up a space, and print an underscore in the same spot.
that's where the \b comes from - it 'backspaced' the printer head one character. there was also a \r which would return the head to the start of the same line. a line-feed character would advance the paper one line, but not move the head.
just about any java book should talk about escape characters.