Hi all, Can any1 pls.. explain 2 me what should be the right way to use the special char. supported by java.... special characters like: '\n' for new line '\r' for return '\t' for tab '\f' for formfeed // by the way... wht. is this? '\b' for backspace My q. is how can we use these in our progs ? THANKS IN ADV. <marquee> Ratul Banerjee </marquee>
[This message has been edited by ratul banji (edited March 23, 2001).]
like this: System.out.println("A\nB\rC\tD\fEEE\b"); check the result, and letter 'B' will not show on the screen because '\r' have move the cursor to the first position of current line then it print 'C'.
Hi there, u just need to place these special codes in the System.out.println(//here) within " ", and thats all. Like System.out.println("Ratul\n is a javaranch member"); u will see that Ratul will be one line above the other part.
These are the escaped forms of ASCII "control codes" - You can't enter them directly because they would interfere with the compiler reading the source code. The compiler converts them to the real control codes when it creates a String or char literal. form feed is the control code that causes a printer to advance to the next form - typical use would be printing invoices, etc. especially with continuous feed paper forms. Bill