Skip to content

Instantly share code, notes, and snippets.

@Fogest
Created March 2, 2014 18:53
Show Gist options
  • Save Fogest/9311628 to your computer and use it in GitHub Desktop.
Save Fogest/9311628 to your computer and use it in GitHub Desktop.
package com.justin.main;
import java.util.Scanner;
/**
* @author Justin
*
* @title Disemvoweler Remove all values from a given string. Output the string
* without the vowels along with the vowels that were removed
*
*/
public class Disemvoweler {
public static void main(String[] args) {
new Disemvoweler();
}
public Disemvoweler() {
Scanner in = new Scanner(System.in);
System.out.println("Input String");
String input = in.nextLine(); // Take in the input.
in.close(); // Close the scanner resource once finished with.
System.out.println(input.replaceAll("[aeoiu ]", ""));
System.out.println(input.replaceAll("[^aeoiu]", ""));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment