Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class TextMsgExpander {
- public static void main (String [] args) {
- System.out.println ("Input an abbreviation: ");
- String textMsg1 = scnr.nextLine();
- System.out.println ("You Entered: " + textMsg1);
- switch(textMsg1) {
- case "LOL" :
- textMsg1.replace ("LOL", "laughing out loud");
- System.out.println ("Replaced 'LOL' with " + textMsg1);
- System.out.println ("Expanded: " + textMsg1 + ".");
- break;
- case "IDK" :
- textMsg1.replace ("IDK", "I don't know");
- System.out.println ("Replaced 'LOL' with " + textMsg1);
- System.out.println ("Expanded: " +textMsg1 + ".");
- break;
- case "BFF" :
- textMsg1.replace ("BFF", "best friends forever");
- System.out.println ("Replaced 'BFF' with " + textMsg1);
- System.out.println ("Expanded: " + textMsg1 + ".");
- break;
- case "IMHO" :
- textMsg1.replace ("IMHO", "in my humble opinion");
- System.out.println ("Replaced 'IMHO' with" + textMsg1);
- System.out.println ("Expanded: " + textMsg1 + ".");
- break;
- case "TMI" :
- textMsg1.replace ("TMI", "too much information");
- System.out.println ("Replaced 'TMI' with " + textMsg1);
- System.out.println ("Expanded: " + textMsg1 + ".");
- break;
- default :
- System.out.println ("Unknown");
- }
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement