title: Counting smileys in a List of strings
body: <p>I am trying to count the occurrence of smileys in a given <code>List</code> of <code>Strings</code>.</p>
  
  <p>Smileys are in format of <code>:</code> or <code>;</code> for eyes, optional nose <code>-</code> or <code>~</code>, and mouth of <code>)</code> or <code>D</code>.</p>
  
  <pre><code>import java.util .*;
  
  public class SmileFaces {
  
      public static int countSmileys(List&lt;String&gt; arrow) {
  
          int countF = 0;
          for (String x : arrow) {
              if (x.charAt(0) == ';' || x.charAt(0) == ':') {
                  if (x.charAt(1) == '-' || x.charAt(1) == '~') {
                      if (x.charAt(2) == ')' || x.charAt(2) == 'D') {
                          countF++;
  
                      } else if (x.charAt(1) == ')' || x.charAt(1) == 'D') {
                          countF++;
  
                      }
  
                  }
  
              }
          }
          return countF;
      }
  }
  </code></pre>