String handling · การจัดการสตริง
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · หน้านี้ต้องใช้เบราว์เซอร์ล่าสุด (รองรับ SharedArrayBuffer) กรุณาอัปเดต Chrome, Edge, Firefox หรือ Safari เป็นเวอร์ชันล่าสุด
English
LENGTH, MID and RIGHT
- The 2026 guide's string routines are
LENGTH,MID,RIGHT,UCASEandLCASE. - Positions start at 1.
MID(text, start, length)copieslengthcharacters fromstart.RIGHT(text, n)copies the lastncharacters.
ไทย
LENGTH, MID และ RIGHT
- ฟังก์ชันจัดการข้อความในคู่มือปี 2026 ได้แก่
LENGTH,MID,RIGHT,UCASEและLCASE - ตำแหน่งเริ่มต้นที่ 1
MID(text, start, length)คัดลอกlengthตัวอักษรจากstartRIGHT(text, n)คัดลอกnตัวอักษรสุดท้าย
OUTPUT LENGTH("Happy Days")
OUTPUT MID("ABCDEFGH", 2, 3)
OUTPUT RIGHT("ABCDEFGH", 3)
English
UCASE and LCASE take one character
- The guide's
UCASEandLCASEtake a single character, not a whole string. UCASE('h')is'H'. A character that is not a letter comes back unchanged.- When a paper needs a whole string in capitals, the insert gives you
TO_UPPER.
ไทย
UCASE และ LCASE รับเฉพาะหนึ่งตัวอักษร
- คู่มือให้
UCASEและLCASEรับ ตัวอักษรเดียว ไม่ใช่ทั้งสตริง UCASE('h')คือ'H'. ตัวอักษรที่ไม่ใช่ตัวอักษร alphabet จะถูกส่งกลับมาโดยไม่เปลี่ยนแปลง- เมื่อกระดาษข้อสอบต้องการข้อความทั้งหมดเป็นตัวพิมพ์ใหญ่ คำแนะนำจะให้คุณใช้
TO_UPPER
OUTPUT UCASE('h')
OUTPUT LCASE('W')
OUTPUT TO_UPPER("Error 803")
English
& joins strings
&concatenates two strings."Summer" & " " & "Pudding"is"Summer Pudding".- IGCSE 0478 has no
&. There you list values afterOUTPUTwith commas. - Commas still work in this guide when you only want them printed side by side.
ไทย
& เชื่อมต่อข้อความ
&เชื่อมต่อข้อความสองชุด."Summer" & " " & "Pudding"คือ"Summer Pudding"- IGCSE 0478 ไม่มี
&. ในข้อสอบนั้น ให้รายการค่าหลังจากOUTPUTด้วยเครื่องหมายคั่น - เครื่องหมายคั่นยังใช้งานได้หากต้องการให้มันปรากฏบนหน้าจอเป็นแถวเดียว
OUTPUT "Summer" & " " & "Pudding"
English
Common mistakes
MIDcounts from 1. The second argument is the start, the third is how many characters.- Do not pass a whole string to
UCASE. That routine is for one character.
ไทย
ข้อผิดพลาดที่พบบ่อย
MIDนับ starting จาก 1. พารามิเตอร์ที่สองคือตำแหน่งเริ่มต้น, พารามิเตอร์ที่สามคือจำนวนตัวอักษร- อย่าส่งข้อความทั้งชุดเข้าไปใน
UCASE. ฟังก์ชันนี้ใช้สำหรับตัวอักษรเดียวเท่านั้น
English
Now you try
- Use
MID,RIGHTand&.
ไทย
ลองดูเลย
- ใช้
MID,RIGHTและ&
Output MID("ABCDEFGH", 2, 3) and RIGHT("ABCDEFGH", 3), each on its own line. · เอาต์พุต MID("ABCDEFGH", 2, 3) และ RIGHT("ABCDEFGH", 3), แต่ละบรรทัด
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่
Output Summer Pudding by joining Summer, a space and Pudding with &. · เอาต์พุต Summer Pudding โดยการรวม Summer, ช่องว่างและ Pudding ด้วย &
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่
Output the upper-case form of the character h, then ERROR 803 using TO_UPPER. · เอาต์พุตรูปแบบตัวอักษรตัวใหญ่ของ h, แล้ว ERROR 803 โดยใช้ TO_UPPER
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่