Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1030134 // shorten_nullOnNull

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2595L/16K).

sS shorten_nullOnNull(CharSequence s) { ret shorten_nullOnNull(s, shorten_default); }

sS shorten_nullOnNull(CharSequence s, int max) {
  ret shorten_nullOnNull(s, max, "...");
}

sS shorten_nullOnNull(CharSequence s, int max, S shortener) {
  if (s == null) null;
  ret shorten(s, max, shortener);
}

sS shorten_nullOnNull(int max, CharSequence s) { ret shorten_nullOnNull(s, max); }

Author comment

Began life as a copy of #1000644

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030134
Snippet name: shorten_nullOnNull
Eternal ID of this version: #1030134/1
Text MD5: 0e5d6da4ee06a21b288019e53a3bff72
Transpilation MD5: 70f6719a43d4f77519a767dfd7a0cd63
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-11 11:07:55
Source code size: 395 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 209 / 309
Referenced in: [show references]