Java toCharArray() 方法
toCharArray() 方法将字符串转换为字符数组。
语法
public char[] toCharArray()
参数
无
返回值
字符数组。
实例
public class Test {
    public static void main(String args[]) {
        String Str = new String("www.runoob.com");
        System.out.print("返回值 :" );
        System.out.println( Str.toCharArray() );
    }
}
以上程序执行结果为:
返回值 :www.runoob.com
 
Java  String类
       
点我分享笔记