Guest User

Untitled

a guest
Mar 20th, 2019
50
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