1 | static L<Int> codepoints(S s) {
|
2 | int n = l(s); |
3 | new L<Int> out; |
4 | for (int offset = 0; offset < n; ) {
|
5 | int codepoint = s.codePointAt(offset); |
6 | out.add(codepoint); |
7 | offset += Character.charCount(codepoint); |
8 | } |
9 | ret out; |
10 | } |
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1024074 |
| Snippet name: | codepoints - list of codepoints in string |
| Eternal ID of this version: | #1024074/1 |
| Text MD5: | 9a17d67468fd1a048bc344b8c5522d14 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-07-20 01:35:07 |
| Source code size: | 243 bytes / 10 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 511 / 511 |
| Referenced in: | [show references] |