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

11
LINES

< > BotCompany Repo | #1027033 // stringChunks

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

Transpiled version (2161L) is out of date.

1  
static LS stringChunks(S s, int chunkSize) {
2  
  int rows = intRatio_ceil(l(s), chunkSize);
3  
  LS out = emptyList(rows);
4  
  for y to rows:
5  
    out.add(substring(s, y*chunkSize, (y+1)*chunkSize));
6  
  ret out;
7  
}
8  
9  
static LS stringChunks(int chunkSize, S s) {
10  
  ret stringChunks(s, chunkSize);
11  
}

Author comment

Began life as a copy of #1020680

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027033
Snippet name: stringChunks
Eternal ID of this version: #1027033/3
Text MD5: 8c9872de8ddfa99c2a8aa899e928cf16
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-28 21:26:48
Source code size: 292 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 285 / 412
Version history: 2 change(s)
Referenced in: [show references]