Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private String transformIWant(String statement)
- {
- // Remove the final period, if there is one
- statement = statement.trim();
- String lastChar = statement.substring(statement.length() - 1);
- if (lastChar.equals("."))
- {
- statement = statement.substring(0, statement.length() - 1);
- }
- int psn = findKeyword (statement, "I want", 0);
- String restOfStatement = statement.substring(psn + 6).trim();
- return "Would you really be happy if you had " + restOfStatement + "?";
- }
- private String transformYouStatement(String statement)
- {
- // Remove the final period, if there is one
- statement = statement.trim();
- String lastChar = statement.substring(statement.length() - 1);
- if (lastChar.equals("."))
- {
- statement = statement.substring(0, statement.length() - 1);
- }
- int psnOfYou = findKeyword (statement, "you", 0);
- String restOfStatement = statement.substring(psnOfYou + 3);
- return "Why do you " + restOfStatement + " me?";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement