Searching...
Friday, 18 October 2013

How to convert Java String to Char array

11:13

Use String.toCharArray() method to convert string to array of charactors.

Example

package com.pretech;
public class StringToCharArray {
	public static void main(String[] args) {
		char[] mycharArray = "Welcome to my blog".toCharArray();
		System.out.println(mycharArray);
		
	}
}

0 comments: