java.util.scanner - Java scanner - Using a new line as a delimeter, but not a blank space? -
this question has answer here:
- java scanner question 3 answers
assuming have 2 lines of text this:
sam|y|rutgers jane|y|penn state
my current scanner report:
sam|y|rutgers jane|y|penn state
instead of keeping penn state together.
is there way can specify delimeter settings include new line, not space?
scanner scan = new scanner(...); string val = scan.nextline();
this set delimiter newline.
Comments
Post a Comment