Revision 63180
Added by Michele Artini about 2 months ago
XsltFunctions.java | ||
---|---|---|
26 | 26 |
return cleanNames(s, StringUtils.countMatches(s, ",") > 1 ? "," : ";"); |
27 | 27 |
} |
28 | 28 |
|
29 |
public static String extractYear(final String s) { |
|
30 |
if (StringUtils.isBlank(s)) { return ""; } |
|
31 |
final Matcher m = Pattern.compile("^.*(\\d{4}).*$").matcher(s); |
|
32 |
return m.matches() ? m.group(1) : ""; |
|
33 |
} |
|
34 |
|
|
29 | 35 |
private static String cleanNames(final String s, final String sep) { |
30 | 36 |
return Arrays.stream(s.split(sep)) |
31 | 37 |
.map(String::trim) |
Also available in: Unified diff
cineca: dates