String handling · Traitement des chaînes
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Cette page nécessite un navigateur récent (avec support SharedArrayBuffer). Veuillez mettre à jour Chrome, Edge, Firefox ou Safari vers la dernière version.
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.
Français
LENGTH, MID et RIGHT
- Les routines de chaîne du guide 2026 sont
LENGTH,MID,RIGHT,UCASEetLCASE. - Les positions commencent à 1.
MID(text, start, length)copielengthcaractères depuisstart.RIGHT(text, n)copie les derniersncaractères.
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.
Français
UCASE et LCASE prennent un seul caractère
- Les
UCASEetLCASEdu guide prennent un seul caractère, pas une chaîne entière. UCASE('h')est'H'. Un caractère qui n'est pas une lettre revient inchangé.- Quand un sujet demande une chaîne entière en majuscules, l'insert vous donne
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.
Français
& joint des chaînes
&concatène deux chaînes."Summer" & " " & "Pudding"est"Summer Pudding".- IGCSE 0478 n'a pas de
&. Là-bas, vous listez les valeurs aprèsOUTPUTavec des virgules. - Les virgules fonctionnent encore dans ce guide quand vous voulez juste qu'elles soient imprimées côte à côte.
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.
Français
Erreurs courantes
MIDcompte à partir de 1. Le deuxième argument est le début, le troisième est le nombre de caractères.- Ne passez pas une chaîne entière à
UCASE. Cette routine est pour un seul caractère.
English
Now you try
- Use
MID,RIGHTand&.
Français
À vous maintenant
- Utilisez
MID,RIGHTet&.
Output · Sortie MID("ABCDEFGH", 2, 3) and · et RIGHT("ABCDEFGH", 3), each on its own line. · Affichez MID("ABCDEFGH", 2, 3) et RIGHT("ABCDEFGH", 3), chacun sur sa propre ligne.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.
Output · Sortie Summer Pudding by joining Summer, a space and Pudding with &. · Affichez Summer Pudding en joignant Summer, un espace et Pudding avec &.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.
Output the upper-case form of the character h, then ERROR 803 using TO_UPPER. · Affichez la forme majuscule du caractère h, puis ERROR 803 en utilisant TO_UPPER.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.