Is there any easy way to ignore hyphens while using scanner? I have a program that will allow you to buy an area (2D array) so if the user want to buy area 3-6, I want scanner to put the number before the hyphen in row and the number after in column. Is there any easy way to do this?
String[][] buyer = new String[10][15];
int row;
int column;
System.out.print("Specify which area you want to buy: ");
row = scan.nextInt();
column = scan.nextInt();
String name;
System.out.print("Name of the buyer: ");
name = scan.nextLine();
buyer[row][colum] = name
if your input is always in this format (num1-num2) then you can use :