Advertisement
Guest User

Untitled

a guest
Dec 25th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. public static String transformIWantToStatement( String statement )
  2. {
  3. if ( statement.indexOf( "I want to" ) >= 0 )
  4. statement = statement.substring( statement.indexOf( "I want to" ) + 9 );
  5. else
  6. statement = statement.substring( statement.indexOf( "I need to" ) + 9 );
  7.  
  8. statement = "What would it mean to you to" + statement;
  9. statement = switchPronouns( statement );
  10. statement = stripFinalPunctuation( statement);
  11. return statement + "?";
  12. }
  13.  
  14. public static String transformIWantStatement( String statement )
  15. {
  16. if ( statement.indexOf( "I want" ) >= 0 )
  17. statement = statement.substring( statement.indexOf( "I want" ) + 6 );
  18. else
  19. statement = statement.substring( statement.indexOf( "I need" ) + 6 );
  20.  
  21. statement = "Would you really be happy if you had" + statement;
  22. statement = switchPronouns( statement );
  23. statement = stripFinalPunctuation( statement);
  24. return statement + "?";
  25. }
  26.  
  27. part 2
  28.  
  29. public static String transformYouMeStatement( String statement )
  30. {
  31. statement = statement.toLowerCase();
  32. statement = statement.substring(indexOfKeyword( statement, "you" ));
  33. statement = statement.substring( indexOfKeyword( statement, "you" ) + 3 , indexOfKeyword ( statement, "me" ) );
  34.  
  35. return "What makes you think that I" + statement + "you?";
  36. }
  37.  
  38. public static String transformIYouStatement( String statement )
  39. {
  40. statement = statement.toLowerCase();
  41. statement = statement.substring(indexOfKeyword( statement, "I" ));
  42. statement = statement.substring( indexOfKeyword( statement, "I" ) + 1 , indexOfKeyword ( statement, "you" ) );
  43.  
  44. return "Why do you" + statement + "me?";
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement