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

21
LINES

< > BotCompany Repo | #1013284 // Test case-insensitive comparison vs toLowerOfToUpper()

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

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

1  
!7
2  
3  
p-tt {
4  
  centerBigConsole();
5  
  int problems = 0;
6  
  for (int i = 0; i <= 0xFFFF; i++) {
7  
    if ((i % 1000) == 0) print(i);
8  
    char c = (char) i;
9  
    S s = str(c);
10  
    for (int j = 0; j <= 0xFFFF; j++) {
11  
      char c2 = (char) j;
12  
      S s2 = str(c2);
13  
      bool b;
14  
      if ((b = eqic(s, s2)) != eq(toLowerOfToUpper(s), toLowerOfToUpper(s2))) {
15  
        print("Problem chars " + b + ": " + i + "/" + j + " - " + s + "/" + toLowerOfToUpper(s) + " - " + s2 + "/" + toLowerOfToUpper(s2));
16  
        ++problems;
17  
      }
18  
    }
19  
  }
20  
  print(n2(problems, "problem char"));
21  
}

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: #1013284
Snippet name: Test case-insensitive comparison vs toLowerOfToUpper()
Eternal ID of this version: #1013284/1
Text MD5: ede7488f021800b080d8dc1793228a8d
Transpilation MD5: e3981b57f833ea793d893ef7abf21427
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:06
Source code size: 587 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 507 / 1218
Referenced in: [show references]