开发者

How can I convert a String to a char array?

开发者 https://www.devze.com 2023-03-01 05:01 出处:网络
Is there any function to do this kind 开发者_运维技巧of job or do one have to parse each char and add it to the array?Use String#toCharArray().

Is there any function to do this kind 开发者_运维技巧of job or do one have to parse each char and add it to the array?


Use String#toCharArray().

char[] chars = "some string".toCharArray();


"read java docs".toCharArray();


Use the String.toCharArray() method.


Use the String.getChars() method.

0

精彩评论

暂无评论...
验证码 换一张
取 消