in reply to How NOT to do it

What makes it even worse, is that he isn't getting the correct length. He's getting the length of the string minus one, since $#temp returns the index of the last element of the array.

Sheez...

[ar0n]