Having some trouble using a delimiter in the scanner class. I've been reading trying to find out why and i cant find an explanation or a better way but i figure people must run into this problem at least a few times.
Scanner input = new Scanner (System.in);
input.useDelimiter("-");
rank=input.next();
suit=input.next();
i want the input to be like 4-H but it wont accept it until i put 4-H- how can i make it accept it with whitespace at the end?
i tried doing
suit=input.nextLine();
but then it returns
4
-H
as the variables...
im also trying to make suit a char but theres no nextChar(); method for scanner apperantly. if there is please tell me.
Thanks in advance.
-Del
Edited by: del3226 on Nov 2, 2008 11:24 AM