Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Author: Kyle Quirk
- import java.util.Scanner;
- public class TextMsgDecoder {
- public static void main(String[] args) {
- Scanner scnr = new Scanner(System.in);
- String userInput;
- String userAcronym;
- System.out.println("Enter text:");
- userInput = scnr.nextLine();
- System.out.println("You entered: " + userInput);
- userInput = userInput.toUpperCase();
- if(userInput.substring(userInput.indexOf("BFF"), userInput.lastIndexOf("BFF")) == "BFF") {
- System.out.println("BFF: best friend forever");
- }
- if(userInput.substring(userInput.indexOf("IDK"), userInput.lastIndexOf("IDK")) == "IDK") {
- System.out.println("IDK: I don't know");
- }
- if(userInput.substring(userInput.indexOf("JK"), userInput.lastIndexOf("JK")) == "JK") {
- System.out.println("JK: just kidding");
- }
- if(userInput.substring(userInput.indexOf("LOL"), userInput.lastIndexOf("LOL")) == "LOL") {
- System.out.println("LOL: laughing out loud");
- }
- if(userInput.substring(userInput.indexOf("TTYL"), userInput.lastIndexOf("TTYL")) == "TTYL") {
- System.out.println("TTYL: talk to you later");
- }
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement