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

21
LINES

< > BotCompany Repo | #1013286 // Test case-insensitive comparison vs toUpper()

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (5892L/39K).

!7

p-tt {
  centerBigConsole();
  int problems = 0;
  for (int i = 0; i <= 0xFFFF; i++) {
    if ((i % 1000) == 0) print(i);
    char c = (char) i;
    S s = str(c);
    for (int j = 0; j <= 0xFFFF; j++) {
      char c2 = (char) j;
      S s2 = str(c2);
      bool b;
      if ((b = eqic(s, s2)) != eq(toUpper(s), toUpper(s2))) {
        print("Problem chars " + b + ": " + i + "/" + j + " - " + s + "/" + toUpper(s) + " - " + s2 + "/" + toUpper(s2));
        ++problems;
      }
    }
  }
  print(n2(problems, "problem char"));
}

Author comment

Began life as a copy of #1013283

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: #1013286
Snippet name: Test case-insensitive comparison vs toUpper()
Eternal ID of this version: #1013286/1
Text MD5: b5be8f0d6f53be3fa993d6f093c90dd6
Transpilation MD5: fe5d4b16d3af7e161cba5e8ae1152968
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-31 07:20:49
Source code size: 551 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 373 / 799
Referenced in: [show references]