will check it tomorrow, thank u , good night
Type: Posts; User: Rexshine
will check it tomorrow, thank u , good night
I don't understand you at all. Do you mean this?
static String leeLinea(BufferedReader br) throws IOException{
char caracter = '\0';
int esNulo = 0;
if((esNulo = (int) br.read()) ==...
I tried many ways but this is the best. that doesn't show first character because i do a read() at start
static String leeLinea(BufferedReader br) throws IOException{
//Character caracter =...
but then i could not return last string in my example input: new StringReader("En un lugar\r\nDe la mancha"))
i only return first line "en un lugar" but second one has append the -1 with...
"The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached"
Some help please. How to return the string when it find \n or when...
it shows '-1' : System.out.println(br.read());
oh my god, now i understand what the -1 that uses the teacher means... thank you
this is like index -1 for string index right?
This is right?
...
I did before, i see the char '?' then i search for char ? that is 63 and tried : if (caracter == (char)63) {return null;} but doesnt work. so i made this to find the ascii code for that char...
Ok, i know exactly what i have to do: I must simulate readLine() method, reading char by char, and returning the first String when find carriage return, and if it is the end of file, must return...
it's how i read a line from a file, but is just an example, how should my method work.
Anyway, if it is too hard, 100% sure i missunderstood my problem. so i ask tomorrow to my teacher. thank you...
"Need to do a method that return a String with the next line to read from a file. When it reach the end of file , it return null instead the String."
Should do this: without using readLine()
...
he don't really say it, but it has no sense that i use readLine inside my method that simulates readLine :confused:
I don't think i should do this
static String leeLinea(BufferedReader br)...
a
--- Update ---
I must return null when it reach end of file.
I must write the code of readLine()
My method must pass a BufferedReader as parameter.
Any idea please? I am stuck, I look at BufferedReader methods but i didn't found any useful, need to do a method that return a String with the next line to read from a file. When it reach the end of...