Guest User

Untitled

a guest
Oct 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. public class TextMessageV2
  2. {
  3. public static void main(String [ ] args)
  4. {
  5. Scanner in;
  6. in = new Scanner(System.in);
  7.  
  8. System.out.println("Please enter any random sentence!");
  9. System.out.println("Try something like \"i'll be back as soon as possible, but i may not be right back, so i'll talk to you later\"");
  10. System.out.print("Start your sentence here: ");
  11. String oldString = in.nextLine();
  12. String newString1 = oldString.replaceAll("i don't know", "idk");
  13. String newString2 = newString1.replaceAll("laughing out loud", "lol");
  14. String newString3 = newString2.replaceAll("be right back", "brb");
  15. String newString4 = newString3.replaceAll("on my way", "omw");
  16. String newString5 = newString4.replaceAll("good luck", "gl");
  17. String newString6 = newString5.replaceAll("good game", "gg");
  18. String newString7 = newString6.replaceAll("love", "<3");
  19. String newString8 = newString7.replaceAll("in my opinion", "imo");
  20. String newString9 = newString8.replaceAll("in my humble opinion", "imho");
  21. String newString10 = newString9.replaceAll("as soon as possible", "asap");
  22. String newString11 = newString10.replaceAll("be back later", "bbl");
  23. String newString12 = newString11.replaceAll("talk to you later", "ttyl");
  24. System.out.println("New string: " + newString12);
  25. }
  26. }
Add Comment
Please, Sign In to add comment