I am currently using split()
to scan through a file where each line has number of strings delimited by '~'
. I read somewhere that Scanner
could do a better job with a long file, performance-wise, so I thought about checking it out.
My question is: Would I have to create two instances of Scanner
? That is, one to read a line and another one based on the line to get tokens for a delimiter? If I have to do so, I doubt if I would get any advantage from using it. Maybe I am missing something here?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…