Code example for Scanner

Methods: closenextLine

0
	 *  
	 * @param args 
	 *            Not used 
	 */ 
	public static void main(String[] args) {
		scanner = new Scanner(System.in);
		printWriter = new PrintWriter(System.out, true);
 
		printWriter.println("Enter a String.");
 
		String text = scanner.nextLine();
		scanner.close();
		text = text.replaceAll(key, replacement);
		printWriter.println(text);
		printWriter.close();
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE