I have the following code in java to read a txt file
// recibe la dirección del archivo
public String leerTxt (String direccion){
String texto="";
try {
BufferedReader bf= new BufferedReader(new FileReader(direccion));
String temp="";
String bfRead;
while ((bfRead = bf.readLine()) != null){ // se hace el ciclo, mientras bfRead tenga datos
temp=temp+bfRead;// guardado del texto de archivo
}
texto= temp;
}
catch (Exception e){
System.out.println("no se encontro archivo");
}
return texto;
}
my question is: how could I make an array with each of the characters of the txt, so if for example I have a file with a hello world, the h is in the 0,0 position of the matrix, the e in position 0.1, etc.