Created
March 2, 2014 18:53
-
-
Save Fogest/9311628 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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