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

23
LINES

< > BotCompany Repo | #1031331 // startsWithAny

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

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

sbool startsWithAny(S a, Cl<S> b) {
  fOr (S prefix : b)
    if (startsWith(a, prefix))
      true;
  false;
}

sbool startsWithAny(S a, S... b) {
  if (b != null)
    fOr (S prefix : b)
      if (startsWith(a, prefix))
        true;
  false;
}

ifclass Matches
sbool startsWithAny(S a, Cl<S> b, Matches m) {
  fOr (S prefix : b)
    if (startsWith(a, prefix, m))
      true;
  false;
}
endif

Author comment

Began life as a copy of #1030624

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031331
Snippet name: startsWithAny
Eternal ID of this version: #1031331/3
Text MD5: bd95d2155675302f6a110c188c100c14
Transpilation MD5: ce98775ae1eb131671db8fbc9d28af1e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-05 02:37:31
Source code size: 414 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 174 / 244
Version history: 2 change(s)
Referenced in: [show references]