Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

28
LINES

< > BotCompany Repo | #1006256 // joinMap - map, then join strings

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (7986L/45K).

1  
// f must return a string
2  
static S joinMap(O f, Iterable l) {
3  
  ret join(map(f, l));
4  
}
5  
6  
static S joinMap(Iterable l, O f) {
7  
  ret joinMap(f, l);
8  
}
9  
10  
static <A> S joinMap(Iterable<A> l, IF1<A, S> f) {
11  
  ret joinMap(f, l);
12  
}
13  
14  
static <A> S joinMap(A[] l, IF1<A, S> f) {
15  
  ret joinMap(f, l);
16  
}
17  
18  
static <A> S joinMap(IF1<A, S> f, Iterable<A> l) {
19  
  ret join(map(f, l));
20  
}
21  
22  
static <A> S joinMap(IF1<A, S> f, A[] l) {
23  
  ret join(map(f, l));
24  
}
25  
26  
static <A, B> S joinMap(S separator, Map<A, B> map, IF2<A, B, S> f) {
27  
  ret join(separator, map(map, f));
28  
}

Author comment

Began life as a copy of #1005492

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1006256
Snippet name: joinMap - map, then join strings
Eternal ID of this version: #1006256/9
Text MD5: df89c72537e0b90d6aefba35cf2d6e8c
Transpilation MD5: 6e05c342369e111664853c0f5196c000
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-01 00:44:34
Source code size: 570 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 554 / 663
Version history: 8 change(s)
Referenced in: [show references]