How can I convert a String to a char array?
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.
精彩评论