wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Convert to upper case Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Convert to upper case " Watch "Convert to upper case " New topic
Author

Convert to upper case

Ajay Joseph
Greenhorn

Joined: Nov 04, 2004
Posts: 21
i used toUpperCase() function but some error like "char cannot be dereferenced " is coming

help me to conert first letter of all word in a sentence to upper case


ajay
John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
Ajay,

Could you please post the code you have so far. From there we can point you in the right direction.

Regards,
JD
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

i used toUpperCase() function but some error like "char cannot be dereferenced " is coming

You are calling it on a char. You can't call methods on primitive types like char.

If you have a single character that you want to make upper case, try this:


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Stuart Ash
Ranch Hand

Joined: Oct 07, 2005
Posts: 637
Originally posted by Ajay Joseph:
i used toUpperCase() function but some error like "char cannot be dereferenced " is coming

help me to conert first letter of all word in a sentence to upper case


ajay


Try this: http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/WordUtils.html


ASCII silly question, Get a silly ANSI.
 
Don't get me started about those stupid light bulbs.
 
subject: Convert to upper case
 
Similar Threads
wordings for error message
Help with Chat software
Problem running servlets in weblogic
Error running JSP file
WANT TO KNOW THE ANT SCRIPT TO CHECKOUT A FILE