Check if input is one single letter (Java)
<p>In my program, I get a user input (String):</p>

<p>ex:</p>

<pre><code>String input = in.nextline();
</code></pre>

<p>I want to check (with an if-function) if the user/string has the following:</p>

<ul>
<li>contains a letter (a-z / A-Z)</li>
<li>only contains one letter (A is valid, AA/AB/LWA is invalid)</li>
</ul>

<p>so what goes on x/x2?</p>

<pre><code>if(input.equals(x) &amp;&amp; input.equals(x2){
    //...
} 
</code></pre>