replaced substring hack for arrayComponentType

Hi,

I replaced a cludgy hack with something more elegant :)

Please merge :)