hasNext implemented in Scanner but ignoring white spaces.