Libraryless. Click here for Pure Java version (2163L/14K).
1 | static L<S> ai_splitCamelCase(S s) {
|
2 | int j = 0; |
3 | new L<S> l; |
4 | |
5 | // new addition |
6 | if (isAllUpperCase(s)) ret l with l.add(s); |
7 | |
8 | for i over s: |
9 | if (i > j && isUpperCaseLetter(s.charAt(i))) {
|
10 | l.add(substring(s, j, i)); |
11 | j = i; |
12 | } |
13 | if (j < l(s)) |
14 | l.add(substring(s, j)); |
15 | ret l; |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1012527 |
| Snippet name: | ai_splitCamelCase |
| Eternal ID of this version: | #1012527/4 |
| Text MD5: | 6531b2515d38ddbee225f6eb531241f0 |
| Transpilation MD5: | 101074febbe7f4bfd3c368a08491be86 |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-09-29 00:25:53 |
| Source code size: | 322 bytes / 16 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 718 / 859 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |