Answer the question
In order to leave comments, you need to log in
How to remove line break from text?
There is a file with text like
"
A1,
B2,
B3,
...
"
String text = "";
try {
FileReader fr = new FileReader("file.txt");
int c;
while((c = fr.read())> 0){
text = text.concat(String.valueOf((char)c));
}
} catch (Exception ex) {
ex.printStackTrace();
}
String[] BukviArray = text.replace("\n","").split(", ");
Answer the question
In order to leave comments, you need to log in
You're reading wrong. Read immediately line by line using https://docs.oracle.com/javase/8/docs/api/java/io/...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question