I am reading a long line of information from a text file that looks something like this:
Sebastien 5000\\Loic 5000\\Shubhashisshh 5000\\Thibaullt 5000\\Caroo 5000\\Blabla 5000\\Okayyy 5000\\SebCed 5000\\abusee 5000\\omg 5000\\
It should be high with usernames. When I print the string, it looks as it should, but when I print the array after using split("\\\\") , it looks like this:
[Sebastien 5000, , Loic 5000, , Shubhashisshh 5000, , Thibaullt 5000, , Caroo 5000, , Blabla 5000, , Okayyy 5000, , SebCed 5000, , abusee 5000, , omg 5000]
The problem is that Array[0] great, but Array[1] empty, like Array[3] , Array[5] , etc.
Here is my code. What is wrong with him?
BufferedReader in = null; try { in = new BufferedReader(new FileReader(path)); } catch (FileNotFoundException e) { e.printStackTrace(); } String line = null; try { line = in.readLine(); } catch (IOException e) { e.printStackTrace(); } System.out.println("LINE = "+line); String[] scores = line.split("\\\\"); System.out.println("Mode = "+mode+Arrays.toString(scores));
user1895293
source share