I was trying to store input as
5
3DRP 3QEW
8AQW 9ADA
I want to read that input in as a copy paste and put it. I've tried this:
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String userNumber;
userNumber = scan.nextLine();
String[] tokens = userNumber.split("[ ]");
System.out.println(tokens[1]);
for(int i = 0; i < tokens.length;i++) {
System.out.println(tokens[i]);
}
scan.close();
}
My goal is to basically read that input in as a copy paste into the IDE or through a file a .txt and then store every single character besides whitespaces into a char array that is 1d or 2d.
split("[ ]");doesn't seem to be required for your input.