Closed richardtallent closed 8 months ago
Hmm... looks like I'm a commit behind and none of this is relevant anymore :)
I did not fully understand the issue/question. Is that a copy of my code? I had it and it does exactly what you describe. I have just found a better way.
Not entirely sure I'm following your code (I can't find where the powers of 10 are actually used, for example).
But something struck me about
IndexOfNewlineChar
: if only\r\n
and\n
variants are supported (not the\r
-only variant that is a relic of old Macs), you can look only for\n
, and if found andidx
> 0, then go see if it is preceeded by\r
and thus needs a 2-character stride. Something like: