Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2939

Newbie Gotcha toLowerCase Locale error.

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.help
Subject Newbie Gotcha toLowerCase Locale error.
Date 2014-04-10 11:29 -0700
Organization Canadian Mind Products
Message-ID <kkodk9lp2j0kgkl5c9utsnntmookudd9l0@4ax.com> (permalink)

Show all headers | View raw


You might inadvertently try writing some code like this:

String lower = String.toLowerCase( upper );
// should be
String lower = upper.tolowerCase();

The compiler will complain about incompatibility with the Locale type.
What is going on? You have inadvertently used the String.toLowerCase(
Locale locale ) method. What you meant to use was
String.toLowerCase(). "String." was taken to mean "this."
-- 
Roedy Green Canadian Mind Products http://mindprod.com
"Don't worry about people stealing an idea; if it's original, you'll
 have to shove it down their throats." 
~ Howard Aiken (born: 1900-03-08 died: 1973-03-14 at age: 73)

Back to comp.lang.java.help | Previous | Next | Find similar | Unroll thread


Thread

Newbie Gotcha toLowerCase Locale error. Roedy Green <see_website@mindprod.com.invalid> - 2014-04-10 11:29 -0700

csiph-web