. coub.com/stories/3061538-warren-reeve-fess-pengantar-akuntansi-salemba-empat-pdf-32-link
warren reeve fess pengantar akuntansi salemba empat pdf.32
.
warren reeve fess pengantar akuntansi salemba empat pdf.32
. coub.com/stories/3061538-warren-reeve-fess-pengantar-akuntansi-salemba-empat-pdf-32-link
warren reeve fess pengantar akuntansi salemba empat pdf.32
.
the code is in Java and as you can see I have 4 lines with the same code just a single space between each one, but when I read it, and convert it in list it only brings me the last one.
I know theres some problem with my string but I dont know how to fix it.
A:
You're using Split(String) - i.e. you're splitting the string on white space, which for you is a single space.
Try using
Pattern.compile("\s+")
instead.
Update: as per your comment:
No I am making a txt file so I dont have any white space between the lines
If this is your problem, then you need to change how you get your string, by replacing your current method with:
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("d:/januari.txt"));
String line;
while ((line = reader.readLine())!= null) {
String[] tokens = line.split("\s+");
System.out.println(tokens);
}
This method reads the entire file into a String and then splits on the whitespace.
Update 2:
Based on your new comment, this is what you need:
BufferedReader reader = new BufferedReader(new InputStreamReader(new File ac619d1d87
Related links:
Comments