Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- the browser keeps sending requests to check
- (?<=^|s)p{L}
- PS> $s = 'the browser keeps sending requests to check'
- PS> -join [regex]::Matches($s, '(?<=^|s)p{L}')
- tbksrtc
- String str = "the browser keeps sending requests to check";
- Matcher m = Pattern.compile("(\S)(\S+)").matcher(str);
- while (m.find()) {
- System.out.print(m.group(1));
- }
- public String generateInitials (String original){
- String[] words= original.split(" ");
- return retrieveInitialsOfEachWord(words);
- }
- private String retrieveInitialsOfEachWord(String[] words){
- String initials = "";
- for(String word : words){
- initials += word.substring(0,1);
- }
- return initials;
- }
Add Comment
Please, Sign In to add comment