Re: Java and Unicode

From: Elliotte Rusty Harold (elharo@metalab.unc.edu)
Date: Thu Nov 16 2000 - 10:57:43 EST


At 7:26 AM -0800 11/16/00, Valeriy E. Ushakov wrote:
>On Thu, Nov 16, 2000 at 05:58:27 -0800, Elliotte Rusty Harold wrote:
>
>> public char charAt(int index)
>>
>> This method is used to walk strings, looking at each character in
>> turn, a useful thing to do. Clearly it would be possible to replace
>> it with a method with a String return type like this:
>>
>> public String characterAt(int index)
>
>And what method you will use to obtain the (single) character in the
>returned string? :-)

The point is you don't need this. You would always work with strings
and never with chars. The API would be changed so that the char data
type could be fully deprecated.

Alternate approach: define a new Char class that could be used in
place of char everywhere a character type was needed.

-- 

+-----------------------+------------------------+-------------------+ | Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer | +-----------------------+------------------------+-------------------+ | The XML Bible (IDG Books, 1999) | | http://metalab.unc.edu/xml/books/bible/ | | http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/ | +----------------------------------+---------------------------------+ | Read Cafe au Lait for Java news: http://metalab.unc.edu/javafaq/ | | Read Cafe con Leche for XML news: http://metalab.unc.edu/xml/ | +----------------------------------+---------------------------------+



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:15 EDT