1 | // Try to get the quoting right... |
2 | |
3 | sS smartJoin(S[] args) { |
4 | if (empty(args)) ret ""; |
5 | if (args.length == 1) return args[0]; |
6 | |
7 | S[] a = new S[args.length]; |
8 | for (int i = 0; i < a.length; i++) |
9 | a[i] = !isJavaIdentifier(args[i]) && !isQuoted(args[i]) ? quote(args[i]) : args[i]; |
10 | return join(" ", a); |
11 | } |
12 | |
13 | static S smartJoin(L<S> args) { |
14 | ret smartJoin(toStringArray(args)); |
15 | } |
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: | #1000918 |
Snippet name: | smartJoin (for joining command line arguments) |
Eternal ID of this version: | #1000918/3 |
Text MD5: | da60739f4d322220e3609584ec9663ac |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-25 17:10:15 |
Source code size: | 397 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 672 / 948 |
Version history: | 2 change(s) |
Referenced in: | [show references] |