Faster get substr of text