Answer the question
In order to leave comments, you need to log in
How to expand lambda into normal code?
please tell me how to translate this into the tranee language from the middle.
the output should be a regular string without interfaces with lambdas
, you need to expand and simplify this thing for understanding.
thanks in advance
public static void main (String[] args)
{
String s = "Два кусо-чека колбаски In Your table someone to eats very speed и ничего не оставил";
Pattern pat = Pattern.compile("\\b(?:(\\p{Lu})|\\p{Ll})(?=\\p{L}{2})");
Matcher match = pat.matcher(s);
System.out.println( match.replaceAll(u ->
u.group(1) == null ? u.group().toUpperCase() : u.group().toLowerCase())
);
}
Answer the question
In order to leave comments, you need to log in
System.out.println( match.replaceAll(new Function<MatchResult, String>() {
@Override
public String apply(MatchResult u) {
return u.group(1) == null ? u.group().toUpperCase() : u.group().toLowerCase();
}
}));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question