Testing substring method