title: Some changes on Soundex Algorithm
body: <p>This algorithm is set to run over the first word or till it fills the four encoded strings. For instance, the result of the input "Horrible Great" is: H612. It neglects the second word, or in other words it takes only the first letter from the second word to fill the encoded string.</p>
  
  <p>I would like to change it by taking the first word and find its encoded string and THEN take the second word and find its encoded string; the output should be "H614 G600".
  Kindly i would like to know if there's a way to do that by doing some changing to **this <em>code</em>.<br>
  Thank you so much :) </p>
  
  <pre><code>    private string Soundex(string data)
      {
          StringBuilder result = new StringBuilder();
          if (data != null &amp;&amp; data.Length &gt; 0)
          {
              string previousCode = "", currentCode = "", currentLetter = "";
              result.Append(data.Substring(0, 1));
              for (int i = 1; i &lt; data.Length; i++)
              {
                  currentLetter = data.Substring(i,1).ToLower();
                  currentCode = "";
  
                  if ("bfpv".IndexOf(currentLetter) &gt; -1)
                      currentCode = "1";
                  else if ("cgjkqsxz".IndexOf(currentLetter) &gt; -1)
                      currentCode = "2";
                  else if ("dt".IndexOf(currentLetter) &gt; -1)
                      currentCode = "3";
                  else if (currentLetter == "l")
                      currentCode = "4";
                  else if ("mn".IndexOf(currentLetter) &gt; -1)
                      currentCode = "5";
                  else if (currentLetter == "r")
                      currentCode = "6";
  
                  if (currentCode != previousCode)
                      result.Append(currentCode);
  
                  if (result.Length == 4) break;
  
                  if (currentCode != "")
                      previousCode = currentCode;
              }
          }
  
          if (result.Length &lt; 4)
              result.Append(new String('0', 4 - result.Length));
  
          return result.ToString().ToUpper();
      }
  </code></pre>