D-ish way to work with strings?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Dec 27 15:35:37 UTC 2019

On Fri, Dec 27, 2019 at 01:23:57PM +0100, Robert M. Münch via Digitalmars-d-learn wrote:
> On 2019-12-23 15:05:20 +0000, H. S. Teoh said:
> > What are you planning to do with your strings?
> Pretty simple: Have user editable content that is rendered using
> different fonts supporting unicode.
> So, all editing functions: insert, replace, delete at all locations in
> the string supporting all unicode characters.

Ah, I see.  In that case you might want to consider using graphemes by
default, since that's what most closely corresponds to how the user will
perceive a "character".  For processing outside of editing, though, you
might want to consider converting to some other representation for
manipulation, since graphemes are slow (the decoding process is complex,
and we can't work around that because that's what Unicode requires).


Windows: the ultimate triumph of marketing over technology. -- Adrian von Bidder

More information about the Digitalmars-d-learn mailing list