-
program help
Alright, I've been trying to right some fake servers in java lately. I have a problem when I do something like this
Code:
String s = null;
s = "hello there" + "\nhow's it going";
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?
Thanks
To see what I'm talking about using windows at the command prompt type
telnet 24.243.64.239 25
and you will see my problem, if you do that using linux it will look fine.
-
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......
-
Thanks tiger shark, I think I got it but haven't tested it yet.
it looks to be \r.
edit
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.
thanks again