var test = "test\u{1F469}" var tset = String(test.reversed()) var tes = test.dropLast()
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
To see that P6 treats the family as one:
https://tio.run/##K0gtyjH7/18BCHIrFWJKUotLFGwV1EG0ukKdQmleZk...
“test\u{1F469}\u{200d}\u{1f469}\u{200d}\u{1f467}\u{200d}\u{1f466}"