Write a lambda expression that takes a single String argument, removes all whitespaces on its both ends and adds PREFIX (before) and SUFFIX (after) to it. PREFIX and SUFFIX are final variables provided in the code template.
Lambda expressions
Creating a closure
Report a typo
Write a program in Java 17
import java.util.function.UnaryOperator;
class PrefixSuffixOperator {
public static final String PREFIX = "__pref__";
public static final String SUFFIX = "__suff__";
public static UnaryOperator<String> operator = // write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.