c*****g 发帖数: 119 | 1 like fscanf("%d %d", &a, &b) in C? |
g*****g 发帖数: 34805 | 2 java.util.Scanner, you are warned this is since 1.5 implementation.
Don't expect your program running under any JVM lower than 1.5.
【在 c*****g 的大作中提到】 : like fscanf("%d %d", &a, &b) in C?
|
c*****g 发帖数: 119 | 3 any other utils for 1.4.2? thanks a lot.
【在 g*****g 的大作中提到】 : java.util.Scanner, you are warned this is since 1.5 implementation. : Don't expect your program running under any JVM lower than 1.5.
|
g*****g 发帖数: 34805 | 4 How about StringTokenizer
【在 c*****g 的大作中提到】 : any other utils for 1.4.2? thanks a lot.
|
c*****g 发帖数: 119 | 5 I am using it.
but I've to new a StringTokenizer very time when read a line.
anyway, thanks a lot.
【在 g*****g 的大作中提到】 : How about StringTokenizer
|
g*****g 发帖数: 34805 | 6 In that case, you probably want to write a utility class for your own good,
and wrap StringTokenizer in it.
【在 c*****g 的大作中提到】 : I am using it. : but I've to new a StringTokenizer very time when read a line. : anyway, thanks a lot.
|
m******t 发帖数: 2416 | 7
I don't think StringTokenizer is thread safe, so
the util class would still have to new StringTokenizer everytime.
【在 g*****g 的大作中提到】 : In that case, you probably want to write a utility class for your own good, : and wrap StringTokenizer in it.
|
d*****n 发帖数: 76 | 8 the String method "split()" might be another choice,
but you have to know a bit of regular expression
【在 c*****g 的大作中提到】 : like fscanf("%d %d", &a, &b) in C?
|
w******n 发帖数: 692 | 9 Why not consider regex? Though not as convenient as Perl.
【在 c*****g 的大作中提到】 : I am using it. : but I've to new a StringTokenizer very time when read a line. : anyway, thanks a lot.
|