Java toCharArray() 方法

Java 教程 · 2019-02-09 07:27:53

toCharArray() 方法将字符串转换为字符数组。

语法

public char[] toCharArray()

参数

  • 无

返回值

字符数组。

实例

public class Test {
    public static void main(String args[]) {
        String Str = new String("www.codercto.com");

        System.out.print("返回值 :" );
        System.out.println( Str.toCharArray() );
    }
}

以上程序执行结果为:

返回值 :www.codercto.com

点击查看所有 Java 教程 文章: https://www.codercto.com/courses/l/12.html

查看所有标签

CSS3 For Web Designers

CSS3 For Web Designers

Dan Cederholm / Happy Cog / 2010-11 / $18

From advanced selectors to generated content to the triumphant return of web fonts, and from gradients, shadows, and rounded corners to full-blown animations, CSS3 is a universe of creative possibilit......一起来看看 《CSS3 For Web Designers》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器