Java toCharArray() 方法
toCharArray() 方法將字符串轉(zhuǎn)換為字符數(shù)組。
語法
public char[] toCharArray()
參數(shù)
無
返回值
字符數(shù)組。
實(shí)例
public class Test { public static void main(String args[]) { String Str = new String("m.o2fo.com"); System.out.print("返回值 :" ); System.out.println( Str.toCharArray() ); } }
以上程序執(zhí)行結(jié)果為:
返回值 :m.o2fo.com
更多建議: