New way of extracting first character

For some reason, ${file:0:1} didn't work for me.

After reading accepted answer on http://stackoverflow.com/questions/10218474/how-to-obtain-the-first-letter-in-a-bash-variable
I tried with that (
<pre>
$(echo $file | head -c 1)
</pre>
), and it works fine.

Also, not needed trailing whitespace is removed.