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

11
LINES

< > BotCompany Repo | #1030849 // flattenStringArray2 - also flattens collections inside array - not recursive

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

Libraryless. Click here for Pure Java version (2753L/16K).

1  
static S[] flattenStringArray2(O... a) {
2  
  new L l;
3  
  if (a != null) for (O x : a)
4  
    if (x cast S[])
5  
      l.addAll(asList(x));
6  
    else if (x cast Collection)
7  
      l.addAll(x);
8  
    else
9  
      l.add(x);
10  
  ret asStringArray(l);
11  
}

Author comment

Began life as a copy of #1010282

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030849
Snippet name: flattenStringArray2 - also flattens collections inside array - not recursive
Eternal ID of this version: #1030849/1
Text MD5: 2db22def0a4cda956a4ec646e3e8ccfb
Transpilation MD5: 996e0b48adfe2f69710b146d438436cb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-02 22:11:13
Source code size: 241 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 172 / 248
Referenced in: [show references]