Java API offers many convenient methods for functional transformations of strings. The powerful text-related API has not changed since Java 12.
Sample code for my post https://marian-caikovski.medium.com/modern-java-methods-for-processing-text-with-streams-and-lambdas-135273475057 new methods for functional programming in Java