Nakulsingh12

Untitled

Dec 6th, 2021 (edited)
957
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. static String text = "This is a copy pasta text";
  2.  
  3. // This block of code finds spaces in a sentence. Like a total space in text for Example: 8.
  4.        for (n=0,m=0; n<text.length(); n++) {
  5.             char ch = text.charAt(n);
  6.  
  7.             if (ch == ' ') {
  8.                 m++;
  9.         }
  10. }
  11. // This block of code finds indexes at spaces. Like [4, 7, 9, 14, 20]
  12. while ((index = text.indexOf(' ',index+1)) >0) {
  13.             add.add(index);
  14.             builder.setCharAt(index,chars(charss));
  15.            
  16.         }
  17.  
  18. // This block of code stores emojis in an array. Like [πŸ˜‚, 😊, πŸ˜‰, 😳, πŸ˜ƒ]
  19. for (int v=0; v<m; v++){
  20.            String s = EmojiParser.parseToUnicode(pickRandomEmoji(emojiNames));
  21.            f.add(s);
  22.        }
  23.  
  24. // I want input something like this ==> ThisπŸ˜‚is😊aπŸ˜‰copy😳pastaπŸ˜ƒtext.
  25.  
Add Comment
Please, Sign In to add comment