findWithinHorizon - how's it working?
<p>There is a code with myScanner.findWithinHorizon.charAt(1). I want to type in a word and then get the second (third, fourth, whatever) letter from that word. If there's .charAt(0), it works and returns the first letter. </p>

<p>Whenever I set a different .charAt(), it doesn't work: <strong>Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 1</strong></p>

<pre><code>public static void main(String[] args) {

    char c1;

    Scanner myScanner = new Scanner(System.in);

    System.out.print("Write something: ");

    c1 = myScanner.findWithinHorizon(".", 0).charAt(1);

    System.out.println(c1);

}
</code></pre>

<p>Thanks.</p>
