Questions tagged [string]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
76 views

How to change string at specific byte index nicely?

I want to change 3rd byte of a string to x, i'm currently using this code: let s = s[:1] . 'x' . s[3:] It's a bit awkward, i wish i can do let s[2] = 'x', but that's not allowed. Are there any ...