title: Counting punctuation marks in a text file using ArrayList and loops arent working properly, how to fix?
body: <p>SOLVED.</p>
  
  <p>I am trying to count how many punctuation marks there are in a text file. I'm using if statements to count the number of each punctuation mark and doesn't seem to be working, it says every element is a full stop.</p>
  
  <p>this is my loop</p>
  
  <pre><code>    for (int c = 0; c &lt;= punk1.size()-1; c++) {
          if (punk1.get(c).matches(".")) {
              fullstop += 1;
          } else if (punk1.get(c).matches(",")) {
              comma += 1;
          } else if (punk1.get(c).matches("?")) {
              qmark += 1;
          } else if (punk1.get(c).matches("!")) {
              expoint += 1;
          } else if (punk1.get(c).matches("\"")) {
              doublequote += 1;
          } else if (punk1.get(c).matches("\'")){
              singlequote += 1;
          } else {
              System.out.println("Punctuation Marks not Found");
          }
      }
  </code></pre>
  
  <p>and this is the output.</p>
  
  <pre><code>Punctuation marks in text file: [., ., ., ,, ,, ,, !, !, !, ?, ?, ?, ", ",", ', ', ']
  Number of Punctuation marks in file: 18
  Number of fullstops: 18
  Number of commass: 0 
  Number of question marks: 0 
  Number of exclamation point: 0 
  Number of double quotes: 0 
  Number of singlequotes: 0
  </code></pre>
  
  <p>there should be 3 for each.</p>