Libraryless. Click here for Pure Java version (3506L/19K).
1 | sS replaceDollarVars_withCustomToString(IF1<O, S> stringifier, S s, O... params) { |
2 | if (empty(params)) ret s; |
3 | MapSO vars = mapKeys dropDollarPrefix((MapSO) litcimap(params)); |
4 | ret replaceDollarVars_dyn(s, var -> { |
5 | O value = vars.get(var); |
6 | ret value == null ?: stringifier.get(value); |
7 | }); |
8 | } |
9 | |
10 | sS replaceDollarVars_withCustomToString(S s, IF1<O, S> stringifier, O... params) { |
11 | ret replaceDollarVars_withCustomToString(stringifier, s, params); |
12 | } |
Began life as a copy of #1028680
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1032132 |
Snippet name: | replaceDollarVars_withCustomToString - does not use a tokenizer |
Eternal ID of this version: | #1032132/4 |
Text MD5: | 3af0f743736687d9479a05b5e3e3ab2d |
Transpilation MD5: | ec4809a3192dba554cc938a8d25e4186 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-08-14 05:51:53 |
Source code size: | 468 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 228 / 304 |
Version history: | 3 change(s) |
Referenced in: | [show references] |