How to get the most left hand string ??

Hi,

I remember once seeing a way to get the left most string in a word.
Let's say: a="First.Second.Third" (separated by dot)

echo ${a#.} shows --> Second.Third
echo ${a##
.} shows --> Third

How do I get the the left most string "First" Or "First.Second" ???

Tried to replace # with + , but it doesn't work.
Can anyone help me?

Thanks,
Joao.

echo ${a%%.} # First
Remove longest match of .
(dot to end of string ) from back of string

echo ${a%.} # First.Second
Remove shortest match of .
(dot to end of string ) from back of string

Thanks it worked just fine.

Joao.