fork(1) download
  1. public class Main {
  2. public static void main(final String[] args){
  3. System.out.println(teenTalk("This is a random sentence that is just a test."));
  4. }
  5.  
  6. public static String teenTalk(String text){
  7. for(int i = 0; i<text.length(); i++)
  8. {
  9. String character = text.substring(i, i+1);
  10. if(character.equals(" "))
  11. {
  12. String front = text.substring(0, i);
  13. String back = text.substring(i+1);
  14. text = front + " like " + back;
  15. i += " like ".length() - 1;
  16. }
  17. }
  18. return text;
  19. }
  20. }
Success #stdin #stdout 0.09s 36052KB
stdin
Standard input is empty
stdout
This like is like a like random like sentence like that like is like just like a like test.