String handling · Manipulação de strings
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Esta página precisa de um navegador recente (com suporte a SharedArrayBuffer). Por favor, atualize Chrome, Edge, Firefox ou Safari para a versão mais recente.
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.
Português
LENGTH, MID e RIGHT
- As rotinas de string do guia de 2026 são
LENGTH,MID,RIGHT,UCASEeLCASE. - As posições começam em 1.
MID(text, start, length)copialengthcaracteres destart.RIGHT(text, n)copia os últimosncaracteres.
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.
Português
UCASE e LCASE pegam um único caractere
- Os
UCASEeLCASEdo guia aceitam um único caractere, não uma string inteira. UCASE('h')é'H'. Um caractere que não é letra volta inalterado.- Quando um papel precisa de uma string inteira em maiúsculas, o insert fornece
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.
Português
& une strings
&concatena duas strings."Summer" & " " & "Pudding"é"Summer Pudding".- O IGCSE 0478 não tem
&. Lá você lista os valores apósOUTPUTcom vírgulas. - Vírgulas ainda funcionam neste guia quando você quer apenas imprimi-las lado a lado.
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.
Português
Erros comuns
MIDconta a partir de 1. O segundo argumento é o início, o terceiro é quantos caracteres.- Não passe uma string inteira para
UCASE. Essa rotina é para um único caractere.
English
Now you try
- Use
MID,RIGHTand&.
Português
Agora você tenta
- Use
MID,RIGHTe&.
Output · Saída MID("ABCDEFGH", 2, 3) and · e RIGHT("ABCDEFGH", 3), each on its own line. · Imprima MID("ABCDEFGH", 2, 3) e RIGHT("ABCDEFGH", 3), cada um em sua própria linha.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
Output · Saída Summer Pudding by joining Summer, a space and Pudding with &. · Imprima Summer Pudding unindo Summer, um espaço e Pudding usando &.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
Output the upper-case form of the character h, then ERROR 803 using TO_UPPER. · Imprima a forma maiúscula do caractere h, seguido de ERROR 803 usando TO_UPPER.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.