java.util.scanner - Java scanner - Using a new line as a delimeter, but not a blank space? -


this question has answer here:

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

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -