Break apart a string by character position
<p>Suppose I have a number that was entered by a user </p>

<pre><code>Scanner input = new Scanner(System.in);

System.out.println("Input a number.");

String num = input.next();
</code></pre>

<p>num must have a length of 50, which is implemented by a boolean method.</p>

<p>How can I create a new string that takes only the first 45 digits of the num?</p>

<p>Example entered string "123456789"</p>

<p>Needed only the first 5 numbers of String num "12345"</p>

<p>Could I convert the string to an int and use modulus?</p>
