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

7
LINES

< > BotCompany Repo | #1029207 // charToIntOrMinus1

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

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

static int charToIntOrMinus1(Char c) {
  ret c == null ? -1 : (int) c;
}

static int charToIntOrMinus1(CharSequence s) {
  ret empty(s) ? -1 : (int) s.charAt(0);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029207
Snippet name: charToIntOrMinus1
Eternal ID of this version: #1029207/3
Text MD5: 2a1ba1f6bd7e7ae79589d7287a45e477
Transpilation MD5: 7b0d63559d5af770e0405a11593e3aa0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-25 12:57:08
Source code size: 169 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 234 / 340
Version history: 2 change(s)
Referenced in: [show references]