Libraryless. Click here for Pure Java version (730L/4K).
1 | sS shortenToFirstAndLast(int chars, S s) { |
2 | if (s == null) ret ""; |
3 | ret s.length() <= chars*2 ? s |
4 | : takeFirst(chars, s) + "..." + takeLast(chars, s); |
5 | } |
Began life as a copy of #1000644
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): gjtlkbvenryc, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1037261 |
Snippet name: | shortenToFirstAndLast |
Eternal ID of this version: | #1037261/1 |
Text MD5: | eca3d48ab78180d734f3671c52c0cacb |
Transpilation MD5: | 9d307bf140be05c2c70bf0c775842947 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2023-10-22 16:08:35 |
Source code size: | 163 bytes / 5 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 148 / 206 |
Referenced in: | [show references] |