Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String cases:Lower,upper etc

 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Salaam/Hi,

My apologize if this post is not eligible for this area.
I would like to know the following:
As the String objects provide methods for converting strings into lower or upper case.Is there any method for converting strings in other cases like title,sentence and toggle cases etc. ?

If not, then would like to know that is there any possibility to add our own methods(custom-level) into Java's deafult package such as java.lang.
So that it becomes available to all java users to use those methods.

What you say ? Isn't good idea.

Regards
Baseet Ahmed
******************
Say Salaam before starting communication(verbal+nonverbal),even before Hi/Hello.
Salaam : Assalam Alekum (Peace may upon you.)
******************
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is there any method for converting strings in other cases like title,sentence and toggle cases etc. ?

No, there are no methods for this in the JDK.


If not, then would like to know that is there any possibility to add our own methods(custom-level) into Java's deafult package such as java.lang.
So that it becomes available to all java users to use those methods.

You can't add them to the JDK, but you could request they be added and see what Sun do. Or you could write your own and publish these via an open source resource like sourceforge.
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apache Commons Lang has WordUtils.capitalize for capitalizing each word, and StringUtils.swapCase for toggling upper and lower case.
 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.


Regards
Baseet Ahmed
******************
Say Salaam before starting communication(verbal+nonverbal),even before Hi/Hello.
Salaam : Assalam Alekum (Peace may upon you.)
******************
 
Rodrigo Lopes
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, since version 6, you can contribute on jdk.
Take a look at http://jdk.dev.java.net/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic