SHARE
TWEET

Untitled

a guest Mar 20th, 2019 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Arrays;
  2. import java.util.stream.Collectors;
  3.  
  4. public class Kata
  5. {
  6.   public static String reverseWords(final String original)
  7.   {
  8.     return Arrays.stream(original.split("(?<=\\s)|(?=\\s+)"))
  9.                 .map(str -> new StringBuilder(str).reverse().toString())
  10.                 .collect(Collectors.joining());
  11.   }
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top