Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: String to char array  (Read 946 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« on: July 23, 2008, 10:56:45 AM »

Here's a demo that shows you how to change the String into a charArray
Code
GeSHi (java):
  1. public class CharDemo {
  2. public static void main(String[] args){
  3.  
  4. String sentence = "This is a sentence";
  5. char[] charSentence = sentence.toCharArray();
  6. for(int i = 0; i < sentence.length(); i++){
  7. System.out.print(charSentence[i]);
  8. }
  9. }
  10. }
  11.  
Created by GeSHI 1.0.7.20
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here