Substring counter that is twice as fast as the string method.