Libraryless. Click here for Pure Java version (3066L/18K).
1 | svoid test_replaceDollarVars() { |
2 | assertEqualsVerbose("Hello Chris Guy $what", |
3 | replaceDollarVars("Hello $firstName $lastName $what", firstName := "Chris", $lastName := "Guy")); |
4 | assertEqualsVerbose("Hello Stefan, what's up", |
5 | replaceDollarVars_dyn("Hello $userName, what's up", var |
6 | -> eq(var, "userName") ? "Stefan" : null)); |
7 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030434 |
Snippet name: | test_replaceDollarVars (OK) |
Eternal ID of this version: | #1030434/3 |
Text MD5: | a21e7bed07d79c4b2d6a6dbe2624bb61 |
Transpilation MD5: | 4031368dfdd1e770a0566e63f93c8650 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-12-21 01:32:18 |
Source code size: | 348 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 284 / 353 |
Version history: | 2 change(s) |
Referenced in: | [show references] |