Re: Converting byte position to character position
Chris Angelico <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <CAPTjJmrVUDiSCRHq2x_XupoFO8BKizspvUCkPFFEp+=gyuuGxw@mail.gmail.com> |
On Fri, Aug 15, 2014 at 8:40 PM, Per Hedbor () @ Pike (-) importmöte för mailinglistan <[email protected]> wrote: > This is the fastest one I have tested yet, but please avoid looking > for byte 10000394 in a 2Mchar long unicode string... :) Fortunately that's unlikely to happen, as the strings it's working on are individual lines of text, meaning they won't usually exceed 80 characters. (They might go to a hundred or so, but not 2MB.) I've made the small optimization you suggest (slicing the text) - thanks! ChrisA