[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [Java] toUpperCase OK med String men ikke med char



Thu, 05 Oct 2006 23:46:06 +0200, Michael Rasmussen <sslug@sslug> skrev:

On Thu, 05 Oct 2006 23:35:29 +0200, Michael Schmidt wrote:


Jeg tror slet ikke jeg har fattet char metoderne...?

Hvorfor vil du opfinde den dybe tallerken en gang til? Metoderne
toUpperCase findes på streng klassen!
Ja det ved jeg. Det var den jeg brugte (med "stor" sucses) i min streng-metode.
Men ifølge java/docs/api/ findes den (= toUpperCase) også til typen char. Jeg kunne bare ikke få den til at gøre det jeg ville.
Martin Møller Pedersen's tip med at pakke min enkelt-karakter ind i ' istedet for " gjorde trikket til at få den opfattet som en char i stedet for enten en streng eller et variabelnavn.

Mht. at håndterer andet end US-ASCII i toUpperCase, gøres det på følgende måde:

String text = "test af æøå";
Locale danish = new Locale("da");
System.out.println(text.toUpperCase(danish));
Det ville være smart, men det håndterer tilsyneladende heller ikke UTF-8 problematikken.




-- Med venlig hilsen /Zmit/ RLU # 314205


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-11-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *