Java toCharArray () method
toCharArray () method to convert a string array of characters.
grammar
public char[] toCharArray()
parameter
no
return value
An array of characters.
Examples
public class Test { public static void main(String args[]) { String Str = new String("www.w3big.com"); System.out.print("返回值 :" ); System.out.println( Str.toCharArray() ); } }
The above program execution results:
返回值 :www.w3big.com