@@ -0,0 +1,920 @@
+package com.sunny.grokkingalgorithms.gfg.amz;%0A%0A/**%0A * Created by sundas on 6/16/2017.%0A */%0Apublic class FindFirstCharOfEveryWord %7B%0A%0A%0A  // http://www.geeksforgeeks.org/string-containing-first-letter-every-word-given-string-spaces/%0A%0A%0A  /**%0A   *%0A   * @param str%0A   * @return%0A   */%0A  public static String findFirstCharacterOfEveryWord(String str)%7B%0A    StringBuilder builder = new StringBuilder();%0A    if(str != null)%7B%0A      //The following regex line is very important%0A      String%5B%5D myWords = str.split(%22(%5C%5Cs)+%22);%0A      for(String word : myWords)%7B%0A        if(word != null) %7B%0A          builder.append(word.charAt(0));%0A        %7D%0A      %7D%0A    %7D%0A    return builder.toString();%0A  %7D%0A%0A%0A  /**%0A   *%0A   * @param args%0A   */%0A  public static void main(String%5B%5D args) %7B%0A    String input = %22Hello     this is a new     string    with multiple spaces    check it out   %22;%0A    System.out.println(findFirstCharacterOfEveryWord(input));%0A  %7D%0A%0A%7D%0A

Find first character of every word in a string separated by spaces. The splitting part is more important.