Java toCharArray () วิธีการ
toCharArray () วิธีการแปลงอาร์เรย์สตริงของตัวละคร
ไวยากรณ์
public char[] toCharArray()
พารามิเตอร์
ไม่
ราคาย้อนกลับ
อาร์เรย์ของตัวละคร
ตัวอย่าง
public class Test { public static void main(String args[]) { String Str = new String("www.w3big.com"); System.out.print("返回值 :" ); System.out.println( Str.toCharArray() ); } }
ดังกล่าวข้างต้นผลการทำงานของโปรแกรม:
返回值 :www.w3big.com