Dave's Brain

Browse - Programming Tips - How do I use java.util.Scanner ?

Date: 2014apr1
Language: Java
Keywords: token, tokenize

Q.  How do I use java.util.Scanner ?

A.

import java.util.Scanner; Scanner scan = new Scanner(sentence); while(scan.hasNext()) { String word = scan.next(); }

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.