October 20th, 2003, 10:20 PM
Alright, I've been trying to right some fake servers in java lately. I have a problem when I do something like this
when this is output the how's it going part is supposed to go onto a new line at the beginning of the line because of the \n. It does that fine when I use the linux telnet, but when I try from windows it puts it on a new line, but not at the beginning, it puts it where it would be if it were still on the line above, but one line below. Is there another tag to use that puts it at the beginning of the line no matter what? Or does someone have another solution?
String s = null;
s = "hello there" + "\nhow's it going";
To see what I'm talking about using windows at the command prompt type
telnet 188.8.131.52 25
and you will see my problem, if you do that using linux it will look fine.
October 20th, 2003, 10:27 PM
As a WAG, (Wild Assed Guess), you are giving it a line feed without a carriage return. You need to look for the code for CR......
Don\'t SYN us.... We\'ll SYN you.....
\"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides
October 20th, 2003, 10:30 PM
Thanks tiger shark, I think I got it but haven't tested it yet.
it looks to be \r.
yup tigershark, you're a genius. I had tried a search earlier for java \n thinking it would turn up all the shortcuts. This time I did java carriage return. I also had to use it like this \n\r instead of \r\n.