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


< > BotCompany Repo | #1029314 - randomSubstring

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

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

sS randomSubstring(S s, int minLength, int maxLength, Random randomizer default defaultRandomizer()) {
  int len = random_incl(minLength, maxLength, randomizer);
  int i = random(l(s)-len, randomizer);
  ret substring(s, i, i+len);

download  show line numbers  debug dex   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029314
Snippet name: randomSubstring
Eternal ID of this version: #1029314/2
Text MD5: ff23b0e0d9abfcf2c1dd400da1a9a588
Transpilation MD5: 2b4514afec62b9335ef9097b114af37a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-30 20:04:04
Source code size: 237 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 37 / 77
Version history: 1 change(s)
Referenced in: [show references]

Formerly at &