Thank you very much, Mart.

Your first solution already works perfectly.
So only the 'Substr' function was the mistake.

The tweaked code looks nice.
I think, I'll use this code \:\)