Balazs_noob
October 26th, 2007, 01:55 PM
hi guys i have a problem with Scanner in Java ...
the problem is that i need to read a date
with dots as delimiters ( like 2007.10.10.)
the date is in strDate and it is correct i checked with the eclipse debugger
i tried
Scanner s = new Scanner(strDate);
s.useDelimiter(".");
System.out.println(s.nextInt());
System.out.println(s.nextInt());
System.out.println(s.nextInt());
which didn't worked, i tried with other delimiters like = and stuff and it worked great, but i need to use dot
any help is appriciated
p.s : i tried \. because it is a special character at Patterns,so i thought i can escape it with this but it didn't worked
the problem is that i need to read a date
with dots as delimiters ( like 2007.10.10.)
the date is in strDate and it is correct i checked with the eclipse debugger
i tried
Scanner s = new Scanner(strDate);
s.useDelimiter(".");
System.out.println(s.nextInt());
System.out.println(s.nextInt());
System.out.println(s.nextInt());
which didn't worked, i tried with other delimiters like = and stuff and it worked great, but i need to use dot
any help is appriciated
p.s : i tried \. because it is a special character at Patterns,so i thought i can escape it with this but it didn't worked