Michael Schnell schrieb:
On 01/25/2013 10:52 AM, Mattias Gaertner wrote:
The above UTF8 example misses some points....
My question was about the want for a construct that allows for accessing the n'th printable character in an UTF-8 string

Everybody can write such a subroutine, when really needed. Or use what the RTL provides for such purpose...

Finding the 100000 th and then independently the 100005 th printable character needs quite a lot of CPU time, so it would be nice to have a kind of "enumerator" that (e.g.) in a smart way remembers a set of (Byte_Position / printable_Character_position) pairs helping to quickly find the n'th printable character.

I think that you are abusing strings for demonstration purposes only. I bet that you really wanted the 100001th character, because you made an mistake while counting characters, or that you missed to organize your super-long string into smaller pieces (lines, columns...).

DoDi

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to