title: Count the number of characters that are received in socket programming
body: <p>This is the code for counting the number of words which works perfectly.</p>
  
  <pre><code>      st=new StringTokenizer(str);
          while(st.hasMoreTokens())
          {
              String s=st.nextToken();
              count++;
          }
  </code></pre>
  
  <p>What is the code for counting the number of characters?</p>