// Try to get the quoting right... sS smartJoin(S[] args) { if (empty(args)) ret ""; if (args.length == 1) return args[0]; S[] a = new S[args.length]; for (int i = 0; i < a.length; i++) a[i] = !isJavaIdentifier(args[i]) && !isQuoted(args[i]) ? quote(args[i]) : args[i]; return join(" ", a); } static S smartJoin(L<S> args) { ret smartJoin(toStringArray(args)); }
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: | 664 / 935 |
Version history: | 2 change(s) |
Referenced in: | #1002427 - Accellerating 629 (SPIKE) #1006654 - Standard functions list 2 (LIVE, continuation of #761) #3000382 - Answer for ferdie (>> t = 1, f = 0) #3000383 - Answer for funkoverflow (>> t=1, f=0 okay) |