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

13
LINES

< > BotCompany Repo | #1024543 // renderVars_str - don't use struct

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (3119L) is out of date.

// Use like this: renderVars(+x, +y)
// Or like this: renderVars("bla", +x, +y)
sS mapMethodLike renderVars_str(O... params) {
  new LS l;
  int i = 0;
  if (odd(l(params))) {
    l.add(strOrNull(first(params)));
    ++i;
  }
  for (; i+1 < l(params); i += 2)
    l.add(params[i] + "=" + params[i+1]);
  ret trim(joinWithComma(l));
}

Author comment

Began life as a copy of #1010650

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1024543
Snippet name: renderVars_str - don't use struct
Eternal ID of this version: #1024543/6
Text MD5: b92a4051f7e0b7313bbeadd04eaad69a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-22 23:29:30
Source code size: 345 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 287 / 429
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1034237 - renderRecordVars
#1034513 - renderVars_stringifier
#1035014 - renderVarsInMultipleLines