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

10
LINES

< > BotCompany Repo | #1011321 // swapFirstTwoLongs

JavaX fragment (include)

static S swapFirstTwoLongs(S s) {
  L<S> tok = javaTok(s);
  int i = 1;
  while (i < l(tok) && !isInteger(tok.get(i))) i += 2;
  int j = i+2;
  while (j < l(tok) && !isInteger(tok.get(j))) j += 2;
  if (j >= l(tok)) ret s;
  swapElements(tok, i, j);
  ret join(tok);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1011321
Snippet name: swapFirstTwoLongs
Eternal ID of this version: #1011321/1
Text MD5: ac40e9351de6d388554cef54f8656292
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-24 04:04:55
Source code size: 277 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 417 / 421
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)