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

13
LINES

< > BotCompany Repo | #1013417 // replaceVars2 - replaceVars + litmap

JavaX fragment (include)

static S replaceVars2(S s, O... params) {
  ret join(replaceVars2(javaTok(s), params));
}
  
static L<S> replaceVars2(L<S> tok, O... params) {
  Map<S, O> map = litmap(params);
  tok = cloneList(tok);
  for (S var : keys(map)) {
    O value = map.get(var);
    jreplace(tok, var, str(value));
  }
  ret tok;
}

Author comment

Began life as a copy of #1004293

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: #1013417
Snippet name: replaceVars2 - replaceVars + litmap
Eternal ID of this version: #1013417/1
Text MD5: a65c7ed9fb2318985243ee9648c43764
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-06 06:09:32
Source code size: 321 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 450 / 469
Referenced in: [show references]