How to check empty spaces in java
<pre><code>String selectedVal = "";

for (SelectItem item : filterItems) {
                selectedVal = item.getValue().toString();
                break;
            }
</code></pre>

<p>I am getting selectedVal="            " how to check this empty space in java.</p>

<p>I tried with if(!selectedVal.equals("") and if(!selectedVal.isEmpty()) but condition getting true.How to check more than one empty space ?</p>
