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)

1  
static S replaceVars2(S s, O... params) {
2  
  ret join(replaceVars2(javaTok(s), params));
3  
}
4  
  
5  
static L<S> replaceVars2(L<S> tok, O... params) {
6  
  Map<S, O> map = litmap(params);
7  
  tok = cloneList(tok);
8  
  for (S var : keys(map)) {
9  
    O value = map.get(var);
10  
    jreplace(tok, var, str(value));
11  
  }
12  
  ret tok;
13  
}

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: 451 / 471
Referenced in: [show references]