|
|
|
|
|
|
16
|
private String generateAcronym(String phrase){
|
16
|
private String generateAcronym(String phrase){
|
|
17
|
final Pattern BREAK_WORDS = Pattern.compile("[A-Z]+[a-z]*|[a-z]+");
|
17
|
final Pattern BREAK_WORDS = Pattern.compile("[A-Z]+[a-z]*|[a-z]+");
|
|
18
|
final Matcher matcher = BREAK_WORDS.matcher(phrase);
|
18
|
final Matcher matcher = BREAK_WORDS.matcher(phrase);
|
|
19
|
- final StringBuilder b = new StringBuilder();
|
|
|
|
|
|
19
|
+ final StringBuilder stringBuilder = new StringBuilder();
|
|
20
|
while (matcher.find()){
|
20
|
while (matcher.find()){
|
|
21
|
- b.append(matcher.group().charAt(0));
|
|
|
|
|
|
21
|
+ stringBuilder.append(matcher.group().charAt(0));
|
|
22
|
}
|
22
|
}
|
|
23
|
- return b.toString().toUpperCase();
|
|
|
|
|
|
23
|
+ return stringBuilder.toString().toUpperCase();
|
|
24
|
}
|
24
|
}
|
|
25
|
|
25
|
|
|
26
|
}
|
26
|
}
|