Libraryless. Click here for Pure Java version (130L/1K).
1 | // works on lists and strings and null |
2 | |
3 | static int indexOfIgnoreCase(L<S> a, S b) { |
4 | ret indexOfIgnoreCase(a, b, 0); |
5 | } |
6 | |
7 | static int indexOfIgnoreCase(L<S> a, S b, int i) { |
8 | int n = a == null ? 0 : a.size(); |
9 | for (; i < n; i++) |
10 | if (eqic(a.get(i), b)) ret i; |
11 | ret -1; |
12 | } |
13 | |
14 | static int indexOfIgnoreCase(S[] a, S b, int i default 0) { |
15 | int n = a == null ? 0 : a.length; |
16 | for (; i < n; i++) |
17 | if (eqic(a[i], b)) ret i; |
18 | ret -1; |
19 | } |
20 | |
21 | static int indexOfIgnoreCase(S a, S b) { |
22 | ret indexOfIgnoreCase_manual(a, b); |
23 | /*Matcher m = Pattern.compile(b, Pattern.CASE_INSENSITIVE + Pattern.LITERAL).matcher(a); |
24 | if (m.find()) return m.start(); else ret -1;*/ |
25 | } |
26 | |
27 | static int indexOfIgnoreCase(S a, S b, int i) { |
28 | ret indexOfIgnoreCase_manual(a, b, i); |
29 | } |
download show line numbers debug dex old transpilations
Travelled to 18 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, lnbujpyubztb, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1000657 |
Snippet name: | indexOfIgnoreCase |
Eternal ID of this version: | #1000657/14 |
Text MD5: | 320c7c489a7f7a85e0ce6656719cf594 |
Transpilation MD5: | 480dc970f01a25fbc3d923bfc178d95b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-11-02 03:25:51 |
Source code size: | 776 bytes / 29 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 853 / 3567 |
Version history: | 13 change(s) |
Referenced in: | [show references] |