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

18
LINES

< > BotCompany Repo | #1012719 // lowerCaseCompare

JavaX fragment (include)

static int lowerCaseCompare(S a, S b) {
  if (a == null) ret b == null ? 0 : -1;
  if (b == null) ret 1;
  
  int len1 = a.length();
  int len2 = b.length();
  int lim = Math.min(len1, len2);

  int k = 0;
  while (k < lim) {
    char c1 = Character.toLowerCase(a.charAt(k));
    char c2 = Character.toLowerCase(b.charAt(k));
    if (c1 != c2)
      ret c1 - c2;
    k++;
  }
  ret len1 - len2;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012719
Snippet name: lowerCaseCompare
Eternal ID of this version: #1012719/2
Text MD5: 77f27a5695ca22121ed4d99ac919c0d2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-10 22:01:46
Source code size: 415 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 401 / 424
Version history: 1 change(s)
Referenced in: [show references]