Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1021711 // tok_joinExtendedUnicodes

JavaX fragment (include)

static LS tok_joinExtendedUnicodes(LS tok) {
  new LS tok2;
  for i over tok: {
    S t = tok.get(i);
    if (odd(i) && isHighSurrogate(t)
      && empty(tok.get(i+1))
      && isLowSurrogate(get(tok, i+2))) {
      tok2.add(tok.get(i) + tok.get(i+2));
      i += 2;
    } else
      tok2.add(t);
  }
  ret tok2;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021711
Snippet name: tok_joinExtendedUnicodes
Eternal ID of this version: #1021711/1
Text MD5: c7f53ef141d32db90f4afb7a3e253d47
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-24 18:34:32
Source code size: 327 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 265 / 301
Referenced in: [show references]