In my code: String nex = keyboard.next (). Split ('/ n'); (Keyboard is Scanner type) How can you identify the space in the .split () and the end of the string.
In my code: String nex = keyboard.next (). Split ('/ n'); (Keyboard is Scanner type) How can you identify the space in the .split () and the end of the string.
It is achieved in the following way:
String nex = teclado.nextLine(); //se debe leer con nextLine no con next
String separado[]=nex.split(" ");
Separated is an arrangement which contains what you have read separated by spaces.