There is a line:
Runaway Train SOUL ASYLUM or Fading Like A Flower ROXETTE
As in Java, using a regular expression, convert (for the first word in which all capital letters) to:
SOUL ASYLUM - Runaway Train
ROXETTE - Fading Like A Flower
There is a line:
Runaway Train SOUL ASYLUM or Fading Like A Flower ROXETTE
As in Java, using a regular expression, convert (for the first word in which all capital letters) to:
SOUL ASYLUM - Runaway Train
ROXETTE - Fading Like A Flower
Here is my solution:
private static String revert(String content) { Pattern pattern = Pattern.compile("[\\p{IsUppercase}]{2,}", Pattern.UNICODE_CASE); Matcher matcher = pattern.matcher(content); if (matcher.find()) { int index = matcher.start(); return content.substring(index) + " - " + content.substring(0, index); } return null; } Source: https://ru.stackoverflow.com/questions/569671/
All Articles
А, and after the lowercase appears and to the end of the line (or rather, before it starts), save in the substringBSo inAyou will have a performer, and inB- the name. - zed