Skip to content

Instantly share code, notes, and snippets.

@TheFauxFox
Last active November 28, 2018 18:54
Show Gist options
  • Save TheFauxFox/73cd2985861998fdf08175a478a2f58f to your computer and use it in GitHub Desktop.
Save TheFauxFox/73cd2985861998fdf08175a478a2f58f to your computer and use it in GitHub Desktop.
I'm otnay ootay uresay why I idday isthay
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) {
while(true) {
Scanner s = new Scanner(System.in);
String st = s.nextLine();
if(st.equals("")) {System.exit(0);}
for(String sr : st.split("\\s+")) {
Matcher p = Pattern.compile("(.*?)([aeiou].*)").matcher(sr);
p.matches();
try {
System.out.print(sr.substring(p.group(1).length()) + p.group(1) + "ay ");
}
catch (Exception e){
System.out.print(sr + " ");
}
}
System.out.println();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment