title: Determine how many digits and letters are in a string
body: <pre><code>import java.util.Scanner;
  
  public class digitthingy
  {
      public static void main(String args[])
      {
          Scanner s = new Scanner(System.in);
      
          String first=&quot;&quot;;
          int firstnum=0;
      
          System.out.print(&quot;Enter a string: &quot;);
          first = s.nextLine();
      
          firstnum = first.indexOf(&quot;1-100&quot;);
      
          System.out.println(firstnum);
      }
  }
  </code></pre>
  <p>I'd like to know how many numbers there are in a certain string I entered, but I have no idea how to do it.</p>