1 | sS format3_round(S pat, S... args) { |
2 | if (empty(args)) ret pat; |
3 | |
4 | L<S> tok = javaTok(pat); |
5 | int argidx = 0; |
6 | for (int i = 1; i < tok.size(); i += 2) |
7 | if (tok.get(i).equals("*")) |
8 | tok.set(i, roundOpt(argidx < args.length ? args[argidx++] : "null")); |
9 | ret join(tok); |
10 | } |
11 | |
12 | sS format3_round(S pat, LS args) { |
13 | ret format3_round(pat, asStringArray(args)); |
14 | } |
Began life as a copy of #1021066
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027123 |
Snippet name: | format3_round - format star pattern, group arguments in round brackets if longer than one token |
Eternal ID of this version: | #1027123/3 |
Text MD5: | 4c81a0d07f7f4d7625ecab3f0000a9c6 |
Author: | stefan |
Category: | javax / parsing |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-02-21 13:10:34 |
Source code size: | 379 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 252 / 280 |
Version history: | 2 change(s) |
Referenced in: | [show references] |