Re: How to check variables for uniqueness ?
- From: John Ersatznom <j.ersatz@xxxxxxxxxxxxxxx>
- Date: Thu, 04 Jan 2007 06:11:34 -0500
Oliver Wong wrote:
"John Ersatznom" <j.ersatz@xxxxxxxxxxxxxxx> wrote in message news:en3as3$p8d$2@xxxxxxxxxxx
Oliver Wong wrote:
assert locale is German; //pseudcode
assert "BEISSEN".toLowerCase().equals("beissen");
assert "BEISSEN".toLowerCase().equals("beißen");
Yeah, and assert "Color".toLowerCase().equals("Colour".toLowerCase()).
{
String originalA = "color";
a = originalA; // "color"
a = a.toUppercase(); // "COLOR"
a = a.toLowercase(); // "color"
assert a.equals(originalA);
}
I don't see "colour" (with a U) in there anywhere, Oliver.
You weren't intended to.
Then you're missing the point entirely. "COLOR" and "colour" differ only by capitalization while "beissen" and "beißen" differ by spelling in a manner similar to "color" vs. "colour". Alternate spellings of the same word can't in general be idenfitied as identical by a computer -- not without a trip through a spellchecking dictionary or the like, anyway. I think you may be expecting too much of Java's humble string classes. Perhaps Collator is smart enough for you?
.
- Follow-Ups:
- Re: How to check variables for uniqueness ?
- From: Oliver Wong
- Re: How to check variables for uniqueness ?
- From: Andrew Thompson
- Re: How to check variables for uniqueness ?
- Prev by Date: Re: How to check variables for uniqueness ?
- Next by Date: Re: java.lang.ClassNotFoundException & Connect to db2/400 through jsp
- Previous by thread: Re: How to check variables for uniqueness ?
- Next by thread: Re: How to check variables for uniqueness ?
- Index(es):
Relevant Pages
|