I would like to send input to my program through standard in(the console) but when I do so, it sends two more characters, Carriage Return and Line Feed. I do not want my program to be reading these. Is there a way I can send what I typed without sending those characters?
Here is my code:
import java.io.IOException;
public class Main {
public static void main(String[] args) {
while (true) {
try {
System.out.println(System.in.read());
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
Console output:
a <- Here I typed 'a' and hit enter
97 <- These three came from stdout
13 <-
10 <-