File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Carriage Return Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Carriage Return" Watch "Carriage Return" New topic

Carriage Return

Mike Shn
Ranch Hand

Joined: May 26, 2001
Posts: 149
What is meaning of Carriage Return operator in JAva?
Carriage Return = \r?
Does this character delete previous word?
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
No, it starts a new line, like hitting Enter.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
WRONG! I thought you said \n (Sorry). This is not a newline character, it is a Carriage Return, which returns you to the beginning of the current line WITHOUT a new line.

System.out.println("xxx xxx x Hello \rJavaRanch");
And the JavaRanch will overtype the x's and you will see
>JavaRanch Hello
[This message has been edited by Cindy Glass (edited May 29, 2001).]
I agree. Here's the link:
subject: Carriage Return