String methods – toString,toUppercase,toLowercase,toChararray

In this post, we will discuss about the string methods toString,toUppercase,toLowercase,toChararray.

Let’s see them one by one with examples.

String toString():

This method returns itself i.e. a same string.


String toUpperCase():

This methods converts all characters of a string into uppercase and returns a string.


String toLowerCase():

It converts all characters of a string into lowercase and returns string.


char[] toCharArray():

This method converts a string into  a new character array.

The length of the array will be same as length of the string.In the below example, it will result in the same string.

Ask Question
If you have any question, you can go to menu ‘Features -> Q&A forum-> Ask Question’.Select the desired category and post your question.
String methods - getBytes() and getChars()
String methods - isEmpty() and lastIndexof
Shekhar Sharma

Shekhar Sharma

Shekhar Sharma is founder of This website is his window to the world. He believes that ,"Knowledge increases by sharing but not by saving".

You may also like...

1 Response

  1. August 7, 2015

    […] char[] toCharArray() […]