| getChars() | ใช้ดึงข้อมูลจากข้อความ string ตั้งแต่ตำแหน่งที่กำหนด จนถึงตำแหน่งที่กำหนด |
|---|
method:getChars ( start, stop, char_array, start_index );
return type:void
content:ใช้ดึงข้อมูลจากข้อความ string ตั้งแต่ตำแหน่งที่กำหนด จนถึงตำแหน่งที่กำหนด และมาเก็บไว้ที่ตัวแปร char_array โดยเริ่มเก็บเข้าตั้งแต่ start_index ของ char_array
example:char [] char_text = new char[13]; char_text[0] = 'b'; char_text[1] = 'a'; char_text[2] = 'm'; String str = new String ( "bamboolabcode" ); str.getChars( 3, 13, char_text, 3 );