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

9
LINES

< > BotCompany Repo | #1028680 // replaceDollarVars - does not use a tokenizer

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

Libraryless. Click here for Pure Java version (3431L/19K).

sS replaceDollarVars(S s, O... params) {
  if (empty(params)) ret s;
  MapSO vars = mapKeys dropDollarPrefix((MapSO) litcimap(params));
  ret replaceDollarVars_dyn(s, var -> strOrNull(vars.get(var)));
}

sS replaceDollarVars(S s, IF1<S> f) {
  ret replaceDollarVars_dyn(s, f);
}

Author comment

Began life as a copy of #1028669

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028680
Snippet name: replaceDollarVars - does not use a tokenizer
Eternal ID of this version: #1028680/5
Text MD5: 2417c29771334df56e876aee0a6f6650
Transpilation MD5: dad7cf24a32673241760436a644a21ea
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-06 01:54:55
Source code size: 286 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 227 / 345
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1030433 - replaceDollarVars_dyn - does not use a tokenizer
#1030664 - replaceDollarVars2 - does not use a tokenizer. also supports ${name}
#1031174 - replaceDollarVars_unindentMLS - unindent multi-line quote and replaceDollarVars
#1032132 - replaceDollarVars_withCustomToString - does not use a tokenizer