• Post Reply Bookmark Topic Watch Topic
  • New Topic

Language Comparison  RSS feed

 
rudresh kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I would like to know we can compare the words other than English in Java

for example, to check if the input string equals to some particular name say "ASHOK"

tempstring.equalsIgnoreCase("ASHOK").

what if the comparison to be done other than English, may be Korean/Chinese/Spanish..

Kindly advise

Thanks
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java source files don't need to be in ASCII. As long as you specify the encoding during compilation (using the "-encoding" switch), then the source file can contain strings in whatever encoding (like Unicode) you desire. That makes it possible to embed CJK characters within Java source code. A better solution than hard-coding would be to read the strings from a file, though.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rudresh kumar wrote:what if the comparison to be done other than English, may be Korean/Chinese/Spanish..

Check out java.text.Collator. Although I'm not sure whether or not in can compare ignoring the case.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!