Libraryless. Click here for Pure Java version (3220L/18K).
1 | sS dropPunctuationAtEnd_noTok(S s) {
|
2 | int i = l(s); |
3 | while (i > 0) {
|
4 | char c = s.charAt(i-1); |
5 | if (isLetterOrDigit(c)) |
6 | break; |
7 | i--; |
8 | } |
9 | ret takeFirst(i, s); |
10 | } |
Began life as a copy of #1008344
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
| Snippet ID: | #1032385 |
| Snippet name: | dropPunctuationAtEnd_noTok |
| Eternal ID of this version: | #1032385/1 |
| Text MD5: | 4e98601d0304d097fee117eee05411b8 |
| Transpilation MD5: | e687716cd5d573f1d478033c629dc8d3 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-09-02 03:06:42 |
| Source code size: | 186 bytes / 10 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 332 / 435 |
| Referenced in: | [show references] |