Convert String to character array

This example shows how to do a String to character array conversion. The String class has a neat method for doing this, toCharArray().
In the code example below the String is converted to a char array and each element of the array is printed out.

The output from the executed code:

Search for more Java info on this site here:
Custom Search

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">