I had that original, but as i am using string.sub quiet a lot at ns2stats plugin i localised it. Just copied this method.