News for hackers. Stuff that matters.
Re:UTF-8 String Indexing Strategies by Someone on Thursday May 30, 2019 @08:00AM (#20050284)
Swift handles both cases well:

    var test = "test\u{1F469}"
    var tset = String(test.reversed())
    var tes = test.dropLast()
(The second line needs the extra ‘String’ to turn a sequence into a String; and yes, the names of the variable do not match their content)
Re:UTF-8 String Indexing Strategies by raiph on Thursday May 30, 2019 @06:36PM (#20056638)
Doing it with just one emoji sort of misses the point...

One way in P6, combining the full family into one character:

    my \test = "test\c[Woman,ZWJ,Woman,ZWJ,Girl,ZWJ,Boy]";
    say test.chars; # 5
    say test;       # test   
    say flip test;  #    tset
    say test.chop;  # test
HN displays the 7 codepoint family as three spaces.

To see that P6 treats the family as one:

https://tio.run/##K0gtyjH7/18BCHIrFWJKUotLFGwV1EG0ukKdQmleZk...

Re:UTF-8 String Indexing Strategies by Someone on Friday May 31, 2019 @02:54AM (#20058750)
Sorry. Tested with the family, but didn’t notice that I only took the single code point when making _something_ show upon HN. It also works for

  “test\u{1F469}\u{200d}\u{1f469}\u{200d}\u{1f467}\u{200d}\u{1f466}"