daily pastebin goal
94%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. the browser keeps sending requests to check
  2.    
  3. (?<=^|s)p{L}
  4.    
  5. PS> $s = 'the browser keeps sending requests to check'
  6. PS> -join [regex]::Matches($s, '(?<=^|s)p{L}')
  7. tbksrtc
  8.    
  9. String str = "the browser keeps sending requests to check";
  10. Matcher m = Pattern.compile("(\S)(\S+)").matcher(str);
  11. while (m.find()) {
  12.     System.out.print(m.group(1));
  13. }
  14.    
  15. public String generateInitials (String original){
  16.     String[] words= original.split(" ");
  17.     return retrieveInitialsOfEachWord(words);
  18. }
  19.  
  20. private String retrieveInitialsOfEachWord(String[] words){
  21.     String initials = "";
  22.     for(String word : words){
  23.         initials += word.substring(0,1);
  24.     }
  25.     return initials;
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top