+1 vote
1.1k views
in Programming by (530 points)
retagged by
I have a string which is very long containing Some paragraphs of a web page Now I want , every letter should be in lower case so that I can compare it, Please tell me conversion of upper case also.
Thanks! 
closed

1 Answer

+1 vote
by Expert (3.8k points)
selected by
 
Best answer

Its very Simple lets say you have a String

strTest = Hello Test.

For Lower Case.

strTest = Hello Test.

strTest = strTest.toLowerCase();

Now strTest will be = hello test.

For Upper Case

strTest = Hello Test.

strTest = strTest.toUpperCase();

Now strTest will be = HELLO TEST.

I hope you got the Answer ,Enjoy!

 

by (530 points)
Thanks Dear it was so simple  :P
by Expert (6.4k points)
@Jatin I have a question what if I have to convert upper case to in this fromat in which first letter would be capital and others letter would be small?
by Expert (5.9k points)
@Krish see this code here we are  Converting a string to in this form where first letter is capital and others are small, As you was asking.
String A = "ASDF";
      String B = A.substring(0, 1).toUpperCase() + A.substring(1).toLowerCase();
      System.out.println(B);

OUT PUT : Asdf

I hope this will help you out.

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated