#Is there something like `strings.write_rune_at` ?

1 messages · Page 1 of 1 (latest)

desert hemlock
#

Hi all! Does anybody know is there any method that would write a char right into string build by index (something like inject(...) for dynamic arrays)?

fast schooner
#

No because that's usually a sign that you've done something wrong.

#

Why are you going back to insert a rune in the builder? Why didn't you write the rune in the first place?

desert hemlock
#

Right now I'm trying to make an editor and use cursor position to dynamically update string buffer depending where the cursor is at the moment and what char user types.

fast schooner
#

Have you checked out core:text/edit?

#

That might solve the problem for you already.

desert hemlock
#

Oh! Just went through the list of core libraries and somehow missed that one.
Thank you so much, I will check that out!

cinder minnow